Commit ca513234 authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Linus Torvalds

[PATCH] Fix hp100.c for pci_enable_device() changes

Don't look at pci_resource_start() before pci_enable_device().
Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ecb5cffa
...@@ -2906,16 +2906,17 @@ static struct eisa_driver hp100_eisa_driver = { ...@@ -2906,16 +2906,17 @@ static struct eisa_driver hp100_eisa_driver = {
static int __devinit hp100_pci_probe (struct pci_dev *pdev, static int __devinit hp100_pci_probe (struct pci_dev *pdev,
const struct pci_device_id *ent) const struct pci_device_id *ent)
{ {
struct net_device *dev = alloc_etherdev(sizeof(struct hp100_private)); struct net_device *dev;
int ioaddr = pci_resource_start(pdev, 0); int ioaddr;
u_short pci_command; u_short pci_command;
int err; int err;
if (!dev) if (pci_enable_device(pdev))
return -ENOMEM; return -ENODEV;
if (pci_enable_device(pdev)) { dev = alloc_etherdev(sizeof(struct hp100_private));
err = -ENODEV; if (!dev) {
err = -ENOMEM;
goto out0; goto out0;
} }
...@@ -2939,7 +2940,7 @@ static int __devinit hp100_pci_probe (struct pci_dev *pdev, ...@@ -2939,7 +2940,7 @@ static int __devinit hp100_pci_probe (struct pci_dev *pdev,
pci_write_config_word(pdev, PCI_COMMAND, pci_command); pci_write_config_word(pdev, PCI_COMMAND, pci_command);
} }
ioaddr = pci_resource_start(pdev, 0);
err = hp100_probe1(dev, ioaddr, HP100_BUS_PCI, pdev); err = hp100_probe1(dev, ioaddr, HP100_BUS_PCI, pdev);
if (err) if (err)
goto out1; goto out1;
...@@ -2956,8 +2957,8 @@ static int __devinit hp100_pci_probe (struct pci_dev *pdev, ...@@ -2956,8 +2957,8 @@ static int __devinit hp100_pci_probe (struct pci_dev *pdev,
release_region(dev->base_addr, HP100_REGION_SIZE); release_region(dev->base_addr, HP100_REGION_SIZE);
out1: out1:
free_netdev(dev); free_netdev(dev);
pci_disable_device(pdev);
out0: out0:
pci_disable_device(pdev);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment