linux-mips
[Top] [All Lists]

[PATCH] ioc3-eth.c: add missing pci_enable_device()

To: Andrew Morton <akpm@osdl.org>
Subject: [PATCH] ioc3-eth.c: add missing pci_enable_device()
From: Bjorn Helgaas <bjorn.helgaas@hp.com>
Date: Wed, 4 Aug 2004 15:38:21 -0600
Cc: ralf@linux-mips.org, linux-mips@linux-mips.org
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
User-agent: KMail/1.6.2
I don't have this hardware, so this has not been tested.


Add pci_enable_device()/pci_disable_device().  In the past, drivers
often worked without this, but it is now required in order to route
PCI interrupts correctly.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>

===== drivers/net/ioc3-eth.c 1.26 vs edited =====
--- 1.26/drivers/net/ioc3-eth.c 2004-06-04 09:49:59 -06:00
+++ edited/drivers/net/ioc3-eth.c       2004-08-04 13:24:07 -06:00
@@ -1172,9 +1172,14 @@
        u32 vendor, model, rev;
        int err;
 
+       if (pci_enable_device(pdev))
+               return -ENODEV;
+
        dev = alloc_etherdev(sizeof(struct ioc3_private));
-       if (!dev)
-               return -ENOMEM;
+       if (!dev) {
+               err = -ENOMEM;
+               goto out_disable;
+       }
 
        err = pci_request_regions(pdev, "ioc3");
        if (err)
@@ -1269,6 +1274,8 @@
        pci_release_regions(pdev);
 out_free:
        free_netdev(dev);
+out_disable:
+       pci_disable_device(pdev);
        return err;
 }
 
@@ -1282,6 +1289,7 @@
        iounmap(ioc3);
        pci_release_regions(pdev);
        free_netdev(dev);
+       pci_disable_device(pdev);
 }
 
 static struct pci_device_id ioc3_pci_tbl[] = {

<Prev in Thread] Current Thread [Next in Thread>