Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] fusion: honour return value of pci_enable_device() in mpt_resume()

Honour the return value of pci_enable_device(), which
seems to be a desirable thing to do:

2.6.20-rc4
gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)

CC [M] drivers/message/fusion/mptbase.o
drivers/message/fusion/mptbase.c: In function `mpt_resume':
drivers/message/fusion/mptbase.c:1541: warning: ignoring return value
of `pci_enable_device', declared with attribute warn_unused_result

It also in turn has mptscsih_resume() honour the return value of
mpt_resume()

I'm not sure about the handling of the other potential error cases
in mpt_resume(), of which there appear to be many. But this does
seem to be a good start.

Signed-off-by: Simon Horman <horms@verge.net.au>
Acked-by: "Moore, Eric" <Eric.Moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>

authored by

Horms and committed by
James Bottomley
b364fd50 a1f9ce05

+5 -3
+4 -1
drivers/message/fusion/mptbase.c
··· 1531 1531 MPT_ADAPTER *ioc = pci_get_drvdata(pdev); 1532 1532 u32 device_state = pdev->current_state; 1533 1533 int recovery_state; 1534 + int err; 1534 1535 1535 1536 printk(MYIOC_s_INFO_FMT 1536 1537 "pci-resume: pdev=0x%p, slot=%s, Previous operating state [D%d]\n", ··· 1539 1538 1540 1539 pci_set_power_state(pdev, 0); 1541 1540 pci_restore_state(pdev); 1542 - pci_enable_device(pdev); 1541 + err = pci_enable_device(pdev); 1542 + if (err) 1543 + return err; 1543 1544 1544 1545 /* enable interrupts */ 1545 1546 CHIPREG_WRITE32(&ioc->chip->IntMask, MPI_HIM_DIM);
+1 -2
drivers/message/fusion/mptscsih.c
··· 1188 1188 int 1189 1189 mptscsih_resume(struct pci_dev *pdev) 1190 1190 { 1191 - mpt_resume(pdev); 1192 - return 0; 1191 + return mpt_resume(pdev); 1193 1192 } 1194 1193 1195 1194 #endif