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

From: Bjorn Helgaas <[email-masked]>
Date: Wed, 4 Aug 2004 15:38:21 -0600

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

===== 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[] = {

---

From: Ralf Baechle <[email-masked]>
Date: Thu, 19 Aug 2004 22:14:08 +0200

> I don't have this hardware, so this has not been tested.

Sure, it's SGI hw ;-)

> PCI interrupts correctly.

Applied.

  Ralf