All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix a logic error in ahci_init_one()
@ 2006-04-14  7:31 zhao, forrest
  2006-04-14  8:47 ` Jeff Garzik
  0 siblings, 1 reply; 3+ messages in thread
From: zhao, forrest @ 2006-04-14  7:31 UTC (permalink / raw)
  To: jgarzik; +Cc: linux-ide

Fix an bug in error handling, also variable
pci_dev_busy has no use, remove it.

Signed-off-by: Zhao Forrest <forrest.zhao@intel.com>


---

This patch is against libata-dev.git upstream[1]

[1] 26ec634c31a11a003040e10b4d650495158632fd

 drivers/scsi/ahci.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/ahci.c b/drivers/scsi/ahci.c
index 1b8429c..8c4ebba 100644
--- a/drivers/scsi/ahci.c
+++ b/drivers/scsi/ahci.c
@@ -1176,7 +1176,7 @@ static int ahci_init_one (struct pci_dev
 	unsigned 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_dev
 		return 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;
 }
 
-- 
1.2.6

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix a logic error in ahci_init_one()
  2006-04-14  7:31 [PATCH] Fix a logic error in ahci_init_one() zhao, forrest
@ 2006-04-14  8:47 ` Jeff Garzik
  2006-04-14  9:12   ` zhao, forrest
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Garzik @ 2006-04-14  8:47 UTC (permalink / raw)
  To: zhao, forrest; +Cc: linux-ide

zhao, forrest wrote:
> Fix an bug in error handling, also variable
> pci_dev_busy has no use, remove it.
> 
> Signed-off-by: Zhao Forrest <forrest.zhao@intel.com>

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




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix a logic error in ahci_init_one()
  2006-04-14  8:47 ` Jeff Garzik
@ 2006-04-14  9:12   ` zhao, forrest
  0 siblings, 0 replies; 3+ messages in thread
From: zhao, forrest @ 2006-04-14  9:12 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linux-ide

On Fri, 2006-04-14 at 04:47 -0400, Jeff Garzik wrote:
> zhao, forrest wrote:
> > Fix an bug in error handling, also variable
> > pci_dev_busy has no use, remove it.
> > 
> > Signed-off-by: Zhao Forrest <forrest.zhao@intel.com>
> 
> 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

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-04-14  9:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-14  7:31 [PATCH] Fix a logic error in ahci_init_one() zhao, forrest
2006-04-14  8:47 ` Jeff Garzik
2006-04-14  9:12   ` zhao, forrest

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.