Subject: [PATCH 2.4.28-rc2-bk3] pcnet32: added pci_disable_device

From: Don Fry <[email-masked]>
Date: Fri, 12 Nov 2004 11:41:24 -0800

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-masked]>

--- 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
[email-masked]