netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.4.28-rc2-bk3] pcnet32: added pci_disable_device
@ 2004-11-12 19:41 Don Fry
  2005-01-07  3:56 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Don Fry @ 2004-11-12 19:41 UTC (permalink / raw)
  To: tsbogend, jgarzik, netdev

This patch adds pci_disable_device to disable the device prior to being
removed or if the probe fails.

Tested ia32.

signed-off-by: Don Fry <brazilnut@us.ibm.com>

--- linux-2.4.28-rc2-bk3/drivers/net/orig.pcnet32.c	2004-11-12 07:45:37.000000000 -0800
+++ linux-2.4.28-rc2-bk3/drivers/net/pcnet32.c	2004-11-12 09:50:31.000000000 -0800
@@ -1007,7 +1007,11 @@ pcnet32_probe_pci(struct pci_dev *pdev, 
 	return -EBUSY;
     }
 
-    return pcnet32_probe1(ioaddr, 1, pdev);
+    err = pcnet32_probe1(ioaddr, 1, pdev);
+    if (err < 0) {
+	pci_disable_device(pdev);
+    }
+    return err;
 }
 
 
@@ -2241,6 +2245,7 @@ static void __devexit pcnet32_remove_one
 	release_region(dev->base_addr, PCNET32_TOTAL_SIZE);
 	pci_free_consistent(lp->pci_dev, sizeof(*lp), lp, lp->dma_addr);
 	free_netdev(dev);
+	pci_disable_device(pdev);
 	pci_set_drvdata(pdev, NULL);
     }
 }

-- 
Don Fry
brazilnut@us.ibm.com

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

* Re: [PATCH 2.4.28-rc2-bk3] pcnet32: added pci_disable_device
  2004-11-12 19:41 [PATCH 2.4.28-rc2-bk3] pcnet32: added pci_disable_device Don Fry
@ 2005-01-07  3:56 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2005-01-07  3:56 UTC (permalink / raw)
  To: Don Fry; +Cc: tsbogend, netdev

applied

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

end of thread, other threads:[~2005-01-07  3:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-12 19:41 [PATCH 2.4.28-rc2-bk3] pcnet32: added pci_disable_device Don Fry
2005-01-07  3:56 ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).