Fix a logic error in ahci_init_one()
PATCH 1/1 Fix a logic error in ahci_init_one()
Fix an bug in error handling, also variablepci_dev_busy has no use, remove it.
---
This patch is against libata-dev.git upstream[1]
[1] 26ec634c31a11a003040e10b4d650495158632fd
drivers/scsi/ahci.c | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-)
drivers/scsi/ahci.c +3 -6
@@ -1176,7 +1176,7 @@ static int ahci_init_one (struct pci_devunsigned long base;void __iomem *mmio_base;unsigned int board_idx = (unsigned int ) ent->driver_data; -int have_msi, pci_dev_busy =0 ; +int have_msi;int rc;VPRINTK ("ENTER\n" );
@@ -1189,10 +1189,8 @@ static int ahci_init_one (struct pci_devreturn rc; rc =pci_request_regions (pdev,DRV_NAME ); -if (rc) { - pci_dev_busy =1 ; +if (rc) goto err_out; - }if (pci_enable_msi (pdev) ==0 ) have_msi =1 ;
@@ -1269,8 +1267,7 @@ err_out_msi:pci_intx (pdev,0 );pci_release_regions (pdev); err_out: -if (!pci_dev_busy) -pci_disable_device (pdev); +pci_disable_device (pdev);return rc; }
Signature · 1 line
1.2.6
Quoted 4 lines · forrest
Fix an bug in error handling, also variable
pci_dev_busyhas no use, remove it.Signed-off-by Zhao Forrest <[email protected]>
What logic error do you see?
pci_dev_busy has a clear use, as illustrated by the code: if the PCI regions are reserved by another device, the device is in use, therefore we should avoid killing the device with pci_disable_device().
Jeff
Quoted 6 lines · Jeff Garzik
Quoted 4 lines · forrest
Fix an bug in error handling, also variable
pci_dev_busyhas no use, remove it.Signed-off-by Zhao Forrest <[email protected]>
Quoted 7 lines
What logic error do you see?
pci_dev_busyhas a clear use, as illustrated by the code: if the PCI regions are reserved by another device, the device is in use, therefore we should avoid killing the device withpci_disable_device().Jeff
Oh, one PCI device can be probed by multiple drivers. It's first time for me to meet such case.
Please forgive my ignorance.
Forrest