diff options
author | jack_wang <jack_wang@usish.com> | 2009-11-05 09:33:51 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-12-04 13:01:32 -0500 |
commit | 97ee20886cfd257a7818087c1638ca60b9ffd192 (patch) | |
tree | 32aaceb5a9bd6366620e0bf10acff06ac1a59931 /drivers/scsi/pm8001/pm8001_init.c | |
parent | 72d0baa089ebd058cdb8b87fde835e9157c4597a (diff) |
[SCSI] pm8001: Fixes for tag alloc, error goto and code cleanup
Allocate right size for bitmap tag,fix error goto and cleanup print
message and undocable commemts. patch attached.
Signed-off-by: Lindar Liu <lindar_liu@usish.com>
Signed-off-by: Jack Wang <jack_wang@usish.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/pm8001/pm8001_init.c')
-rw-r--r-- | drivers/scsi/pm8001/pm8001_init.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c index 811b5d36d5f0..42ebe725d5a5 100644 --- a/drivers/scsi/pm8001/pm8001_init.c +++ b/drivers/scsi/pm8001/pm8001_init.c | |||
@@ -203,9 +203,9 @@ static int __devinit pm8001_alloc(struct pm8001_hba_info *pm8001_ha) | |||
203 | for (i = 0; i < pm8001_ha->chip->n_phy; i++) | 203 | for (i = 0; i < pm8001_ha->chip->n_phy; i++) |
204 | pm8001_phy_init(pm8001_ha, i); | 204 | pm8001_phy_init(pm8001_ha, i); |
205 | 205 | ||
206 | pm8001_ha->tags = kmalloc(sizeof(*pm8001_ha->tags)*PM8001_MAX_DEVICES, | 206 | pm8001_ha->tags = kzalloc(PM8001_MAX_CCB, GFP_KERNEL); |
207 | GFP_KERNEL); | 207 | if (!pm8001_ha->tags) |
208 | 208 | goto err_out; | |
209 | /* MPI Memory region 1 for AAP Event Log for fw */ | 209 | /* MPI Memory region 1 for AAP Event Log for fw */ |
210 | pm8001_ha->memoryMap.region[AAP1].num_elements = 1; | 210 | pm8001_ha->memoryMap.region[AAP1].num_elements = 1; |
211 | pm8001_ha->memoryMap.region[AAP1].element_size = PM8001_EVENT_LOG_SIZE; | 211 | pm8001_ha->memoryMap.region[AAP1].element_size = PM8001_EVENT_LOG_SIZE; |
@@ -287,6 +287,9 @@ static int __devinit pm8001_alloc(struct pm8001_hba_info *pm8001_ha) | |||
287 | pm8001_ha->ccb_info[i].ccb_dma_handle = | 287 | pm8001_ha->ccb_info[i].ccb_dma_handle = |
288 | pm8001_ha->memoryMap.region[CCB_MEM].phys_addr + | 288 | pm8001_ha->memoryMap.region[CCB_MEM].phys_addr + |
289 | i * sizeof(struct pm8001_ccb_info); | 289 | i * sizeof(struct pm8001_ccb_info); |
290 | pm8001_ha->ccb_info[i].task = NULL; | ||
291 | pm8001_ha->ccb_info[i].ccb_tag = 0xffffffff; | ||
292 | pm8001_ha->ccb_info[i].device = NULL; | ||
290 | ++pm8001_ha->tags_num; | 293 | ++pm8001_ha->tags_num; |
291 | } | 294 | } |
292 | pm8001_ha->flags = PM8001F_INIT_TIME; | 295 | pm8001_ha->flags = PM8001F_INIT_TIME; |
@@ -578,7 +581,7 @@ static u32 pm8001_request_irq(struct pm8001_hba_info *pm8001_ha) | |||
578 | { | 581 | { |
579 | struct pci_dev *pdev; | 582 | struct pci_dev *pdev; |
580 | irq_handler_t irq_handler = pm8001_interrupt; | 583 | irq_handler_t irq_handler = pm8001_interrupt; |
581 | u32 rc; | 584 | int rc; |
582 | 585 | ||
583 | pdev = pm8001_ha->pdev; | 586 | pdev = pm8001_ha->pdev; |
584 | 587 | ||