pcnet32: added pci_disable_device
Subsystems (2)
PATCH 1/1 pcnet32: added pci_disable_device
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 <[email protected]>
drivers/net/pcnet32.c renamed from drivers/net/orig.pcnet32.c +6 -1
@@ -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_onerelease_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 ); } }
Signature · 2 lines
Don Fry [email protected]
Jeff Garzik
Appliedapplied