Re: [PATCH] starfire reads irq before pci_enable_device.

davej
2001-02-07T19:53:13Z

> rejected -- ioaddr assigned a value before pci_enable_device is called

Better ?

Dave.

--
| Dave Jones. http://www.suse.de/~davej
| SuSE Labs

diff -urN --exclude-from=/home/davej/.exclude linux/drivers/net/starfire.c linux-dj/drivers/net/starfire.c
--- linux/drivers/net/starfire.c Wed Feb 7 12:42:42 2001
+++ linux-dj/drivers/net/starfire.c Wed Feb 7 19:47:54 2001
@@ -396,12 +396,6 @@
printk(KERN_INFO "%s" KERN_INFO "%s" KERN_INFO "%s",
version1, version2, version3);

- ioaddr = pci_resource_start (pdev, 0);
- if (!ioaddr || ((pci_resource_flags (pdev, 0) & IORESOURCE_MEM) == 0)) {
- printk (KERN_ERR "starfire %d: no PCI MEM resources, aborting\n", card_idx);
- return -ENODEV;
- }
-
dev = init_etherdev(NULL, sizeof(*np));
if (!dev) {
printk (KERN_ERR "starfire %d: cannot alloc etherdev, aborting\n", card_idx);
@@ -409,6 +403,14 @@
}
SET_MODULE_OWNER(dev);

+ if (pci_enable_device (pdev))
+ goto err_out_free_netdev;
+
+ ioaddr = pci_resource_start (pdev, 0);
+ if (!ioaddr || ((pci_resource_flags (pdev, 0) & IORESOURCE_MEM) == 0)) {
+ printk (KERN_ERR "starfire %d: no PCI MEM resources, aborting\n", card_idx);
+ return -ENODEV;
+ }
irq = pdev->irq;

if (request_mem_region (ioaddr, io_size, dev->name) == NULL) {
@@ -416,10 +418,7 @@
card_idx, io_size, ioaddr);
goto err_out_free_netdev;
}
-
- if (pci_enable_device (pdev))
- goto err_out_free_res;
-
+
ioaddr = (long) ioremap (ioaddr, io_size);
if (!ioaddr) {
printk (KERN_ERR "starfire %d: cannot remap 0x%x @ 0x%lx, aborting\n",