aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/cciss.c
diff options
context:
space:
mode:
authorMike Miller <mike.miller@hp.com>2008-11-06 15:53:25 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-11-06 18:41:18 -0500
commit22bece00dc1f28dd3374c55e464c9f02eb642876 (patch)
tree40d6865b9d7e1f563d6b9cc2318f5c90622ff765 /drivers/block/cciss.c
parent404443081ce5e6f68b5f7eda16c959835ff200c0 (diff)
cciss: fix regression firmware not displayed in procfs
This regression was introduced by commit 6ae5ce8e8d4de666f31286808d2285aa6a50fa40 ("cciss: remove redundant code"). This patch fixes a regression where the controller firmware version is not displayed in procfs. The previous patch would be called anytime something changed. This will get called only once for each controller. Signed-off-by: Mike Miller <mike.miller@hp.com> Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: Jens Axboe <jens.axboe@oracle.com> Cc: <stable@kernel.org> [2.6.27.x] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/block/cciss.c')
-rw-r--r--drivers/block/cciss.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index dc38368435aa..12de1fdaa6c6 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -3409,7 +3409,8 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
3409 int i; 3409 int i;
3410 int j = 0; 3410 int j = 0;
3411 int rc; 3411 int rc;
3412 int dac; 3412 int dac, return_code;
3413 InquiryData_struct *inq_buff = NULL;
3413 3414
3414 i = alloc_cciss_hba(); 3415 i = alloc_cciss_hba();
3415 if (i < 0) 3416 if (i < 0)
@@ -3515,6 +3516,25 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
3515 /* Turn the interrupts on so we can service requests */ 3516 /* Turn the interrupts on so we can service requests */
3516 hba[i]->access.set_intr_mask(hba[i], CCISS_INTR_ON); 3517 hba[i]->access.set_intr_mask(hba[i], CCISS_INTR_ON);
3517 3518
3519 /* Get the firmware version */
3520 inq_buff = kzalloc(sizeof(InquiryData_struct), GFP_KERNEL);
3521 if (inq_buff == NULL) {
3522 printk(KERN_ERR "cciss: out of memory\n");
3523 goto clean4;
3524 }
3525
3526 return_code = sendcmd_withirq(CISS_INQUIRY, i, inq_buff,
3527 sizeof(InquiryData_struct), 0, 0 , 0, TYPE_CMD);
3528 if (return_code == IO_OK) {
3529 hba[i]->firm_ver[0] = inq_buff->data_byte[32];
3530 hba[i]->firm_ver[1] = inq_buff->data_byte[33];
3531 hba[i]->firm_ver[2] = inq_buff->data_byte[34];
3532 hba[i]->firm_ver[3] = inq_buff->data_byte[35];
3533 } else { /* send command failed */
3534 printk(KERN_WARNING "cciss: unable to determine firmware"
3535 " version of controller\n");
3536 }
3537
3518 cciss_procinit(i); 3538 cciss_procinit(i);
3519 3539
3520 hba[i]->cciss_max_sectors = 2048; 3540 hba[i]->cciss_max_sectors = 2048;
@@ -3525,6 +3545,7 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
3525 return 1; 3545 return 1;
3526 3546
3527clean4: 3547clean4:
3548 kfree(inq_buff);
3528#ifdef CONFIG_CISS_SCSI_TAPE 3549#ifdef CONFIG_CISS_SCSI_TAPE
3529 kfree(hba[i]->scsi_rejects.complete); 3550 kfree(hba[i]->scsi_rejects.complete);
3530#endif 3551#endif