]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] pcnet32: added pci_disable_device
authorDon Fry <brazilnut@us.ibm.com>
Wed, 24 Nov 2004 10:23:30 +0000 (05:23 -0500)
committerJeff Garzik <jgarzik@pobox.com>
Wed, 24 Nov 2004 10:23:30 +0000 (05:23 -0500)
This patch adds pci_disable_device in the appropriate places to
eliminate the following message when removing the module.

pcnet32 0000:00:05.0: Device was removed without properly calling pci_disable_device(). This may need fixing.
pcnet32 0000:02:05.0: Device was removed without properly calling pci_disable_device(). This may need fixing.

Tested ia32.

signed-off-by: Don Fry <brazilnut@us.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
drivers/net/pcnet32.c

index 8145eead2e8c964e50ede0ed9b01f15aa60abd5f..381b785906ce2c586cd1c016122f4a25a170b6ae 100644 (file)
@@ -1010,7 +1010,11 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent)
        return -EBUSY;
     }
 
-    return pcnet32_probe1(ioaddr, 1, pdev);
+    err =  pcnet32_probe1(ioaddr, 1, pdev);
+    if (err < 0) {
+       pci_disable_device(pdev);
+    }
+    return err;
 }
 
 
@@ -2249,6 +2253,7 @@ static void __devexit pcnet32_remove_one(struct pci_dev *pdev)
        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);
     }
 }