]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Fix hp100.c for pci_enable_device() changes
authorBjorn Helgaas <bjorn.helgaas@hp.com>
Fri, 27 Aug 2004 03:44:56 +0000 (20:44 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 27 Aug 2004 03:44:56 +0000 (20:44 -0700)
Don't look at pci_resource_start() before pci_enable_device().

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/net/hp100.c

index 4f5256eb8bfea544be22b9641877076b7d85b8c5..3c783a4591fe92c0aed0ba76a6e35fc003f05862 100644 (file)
@@ -2906,16 +2906,17 @@ static struct eisa_driver hp100_eisa_driver = {
 static int __devinit hp100_pci_probe (struct pci_dev *pdev,
                                     const struct pci_device_id *ent)
 {
-       struct net_device *dev = alloc_etherdev(sizeof(struct hp100_private));
-       int ioaddr = pci_resource_start(pdev, 0);
+       struct net_device *dev;
+       int ioaddr;
        u_short pci_command;
        int err;
 
-       if (!dev)
-               return -ENOMEM;
+       if (pci_enable_device(pdev))
+               return -ENODEV;
 
-       if (pci_enable_device(pdev)) {
-               err = -ENODEV;
+       dev = alloc_etherdev(sizeof(struct hp100_private));
+       if (!dev) {
+               err = -ENOMEM;
                goto out0;
        }
 
@@ -2939,7 +2940,7 @@ static int __devinit hp100_pci_probe (struct pci_dev *pdev,
                pci_write_config_word(pdev, PCI_COMMAND, pci_command);
        }
        
-
+       ioaddr = pci_resource_start(pdev, 0);
        err = hp100_probe1(dev, ioaddr, HP100_BUS_PCI, pdev);
        if (err) 
                goto out1;
@@ -2956,8 +2957,8 @@ static int __devinit hp100_pci_probe (struct pci_dev *pdev,
        release_region(dev->base_addr, HP100_REGION_SIZE);
  out1:
        free_netdev(dev);
-       pci_disable_device(pdev);
  out0:
+       pci_disable_device(pdev);
        return err;
 }