diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-15 11:19:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-15 11:19:33 -0400 |
commit | df3d80f5a5c74168be42788364d13cf6c83c7b9c (patch) | |
tree | 892a964c2fd28d028f2fb7471e8543d3f4006a58 /drivers/scsi/dpt_i2o.c | |
parent | 3d06f7a5f74a813cee817c4b30b5e6f0398da0be (diff) | |
parent | c8e91b0a8fc8493e3bf3efcb3c8f866e9453cf1c (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (207 commits)
[SCSI] gdth: fix CONFIG_ISA build failure
[SCSI] esp_scsi: remove __dev{init,exit}
[SCSI] gdth: !use_sg cleanup and use of scsi accessors
[SCSI] gdth: Move members from SCp to gdth_cmndinfo, stage 2
[SCSI] gdth: Setup proper per-command private data
[SCSI] gdth: Remove gdth_ctr_tab[]
[SCSI] gdth: switch to modern scsi host registration
[SCSI] gdth: gdth_interrupt() gdth_get_status() & gdth_wait() fixes
[SCSI] gdth: clean up host private data
[SCSI] gdth: Remove virt hosts
[SCSI] gdth: Reorder scsi_host_template intitializers
[SCSI] gdth: kill gdth_{read,write}[bwl] wrappers
[SCSI] gdth: Remove 2.4.x support, in-kernel changelog
[SCSI] gdth: split out pci probing
[SCSI] gdth: split out eisa probing
[SCSI] gdth: split out isa probing
gdth: Make one abuse of scsi_cmnd less obvious
[SCSI] NCR5380: Use scsi_eh API for REQUEST_SENSE invocation
[SCSI] usb storage: use scsi_eh API in REQUEST_SENSE execution
[SCSI] scsi_error: Refactoring scsi_error to facilitate in synchronous REQUEST_SENSE
...
Diffstat (limited to 'drivers/scsi/dpt_i2o.c')
-rw-r--r-- | drivers/scsi/dpt_i2o.c | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c index 502732ac270..bea9d659af1 100644 --- a/drivers/scsi/dpt_i2o.c +++ b/drivers/scsi/dpt_i2o.c | |||
@@ -949,16 +949,14 @@ static int adpt_install_hba(struct pci_dev* pDev) | |||
949 | } | 949 | } |
950 | 950 | ||
951 | // Allocate and zero the data structure | 951 | // Allocate and zero the data structure |
952 | pHba = kmalloc(sizeof(adpt_hba), GFP_KERNEL); | 952 | pHba = kzalloc(sizeof(adpt_hba), GFP_KERNEL); |
953 | if( pHba == NULL) { | 953 | if (!pHba) { |
954 | if(msg_addr_virt != base_addr_virt){ | 954 | if (msg_addr_virt != base_addr_virt) |
955 | iounmap(msg_addr_virt); | 955 | iounmap(msg_addr_virt); |
956 | } | ||
957 | iounmap(base_addr_virt); | 956 | iounmap(base_addr_virt); |
958 | pci_release_regions(pDev); | 957 | pci_release_regions(pDev); |
959 | return -ENOMEM; | 958 | return -ENOMEM; |
960 | } | 959 | } |
961 | memset(pHba, 0, sizeof(adpt_hba)); | ||
962 | 960 | ||
963 | mutex_lock(&adpt_configuration_lock); | 961 | mutex_lock(&adpt_configuration_lock); |
964 | 962 | ||
@@ -2622,14 +2620,13 @@ static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba) | |||
2622 | 2620 | ||
2623 | msg=(u32 __iomem *)(pHba->msg_addr_virt+m); | 2621 | msg=(u32 __iomem *)(pHba->msg_addr_virt+m); |
2624 | 2622 | ||
2625 | status = kmalloc(4,GFP_KERNEL|ADDR32); | 2623 | status = kzalloc(4, GFP_KERNEL|ADDR32); |
2626 | if (status==NULL) { | 2624 | if (!status) { |
2627 | adpt_send_nop(pHba, m); | 2625 | adpt_send_nop(pHba, m); |
2628 | printk(KERN_WARNING"%s: IOP reset failed - no free memory.\n", | 2626 | printk(KERN_WARNING"%s: IOP reset failed - no free memory.\n", |
2629 | pHba->name); | 2627 | pHba->name); |
2630 | return -ENOMEM; | 2628 | return -ENOMEM; |
2631 | } | 2629 | } |
2632 | memset(status, 0, 4); | ||
2633 | 2630 | ||
2634 | writel(EIGHT_WORD_MSG_SIZE| SGL_OFFSET_6, &msg[0]); | 2631 | writel(EIGHT_WORD_MSG_SIZE| SGL_OFFSET_6, &msg[0]); |
2635 | writel(I2O_CMD_OUTBOUND_INIT<<24 | HOST_TID<<12 | ADAPTER_TID, &msg[1]); | 2632 | writel(I2O_CMD_OUTBOUND_INIT<<24 | HOST_TID<<12 | ADAPTER_TID, &msg[1]); |
@@ -2668,12 +2665,11 @@ static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba) | |||
2668 | 2665 | ||
2669 | kfree(pHba->reply_pool); | 2666 | kfree(pHba->reply_pool); |
2670 | 2667 | ||
2671 | pHba->reply_pool = kmalloc(pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4, GFP_KERNEL|ADDR32); | 2668 | pHba->reply_pool = kzalloc(pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4, GFP_KERNEL|ADDR32); |
2672 | if(!pHba->reply_pool){ | 2669 | if (!pHba->reply_pool) { |
2673 | printk(KERN_ERR"%s: Could not allocate reply pool\n",pHba->name); | 2670 | printk(KERN_ERR "%s: Could not allocate reply pool\n", pHba->name); |
2674 | return -1; | 2671 | return -ENOMEM; |
2675 | } | 2672 | } |
2676 | memset(pHba->reply_pool, 0 , pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4); | ||
2677 | 2673 | ||
2678 | ptr = pHba->reply_pool; | 2674 | ptr = pHba->reply_pool; |
2679 | for(i = 0; i < pHba->reply_fifo_size; i++) { | 2675 | for(i = 0; i < pHba->reply_fifo_size; i++) { |
@@ -2884,12 +2880,11 @@ static int adpt_i2o_build_sys_table(void) | |||
2884 | 2880 | ||
2885 | kfree(sys_tbl); | 2881 | kfree(sys_tbl); |
2886 | 2882 | ||
2887 | sys_tbl = kmalloc(sys_tbl_len, GFP_KERNEL|ADDR32); | 2883 | sys_tbl = kzalloc(sys_tbl_len, GFP_KERNEL|ADDR32); |
2888 | if(!sys_tbl) { | 2884 | if (!sys_tbl) { |
2889 | printk(KERN_WARNING "SysTab Set failed. Out of memory.\n"); | 2885 | printk(KERN_WARNING "SysTab Set failed. Out of memory.\n"); |
2890 | return -ENOMEM; | 2886 | return -ENOMEM; |
2891 | } | 2887 | } |
2892 | memset(sys_tbl, 0, sys_tbl_len); | ||
2893 | 2888 | ||
2894 | sys_tbl->num_entries = hba_count; | 2889 | sys_tbl->num_entries = hba_count; |
2895 | sys_tbl->version = I2OVERSION; | 2890 | sys_tbl->version = I2OVERSION; |
@@ -3351,7 +3346,7 @@ static int __init adpt_init(void) | |||
3351 | return count > 0 ? 0 : -ENODEV; | 3346 | return count > 0 ? 0 : -ENODEV; |
3352 | } | 3347 | } |
3353 | 3348 | ||
3354 | static void __exit adpt_exit(void) | 3349 | static void adpt_exit(void) |
3355 | { | 3350 | { |
3356 | while (hba_chain) | 3351 | while (hba_chain) |
3357 | adpt_release(hba_chain); | 3352 | adpt_release(hba_chain); |