hp100.c: add missing pci_enable_device()
A message that is not in the archive (sent off-list or not yet received): [email protected]
drivers/net/hp100.c line 2917
Quoted 13 lines · Linux Kernel Mailing List
diff -Nru
a/drivers/net/hp100.cb/drivers/net/hp100.cdrivers/net/hp100.c +2
-1@@ -2910,10 +2910,15 @@int ioaddr =pci_resource_start (pdev,0 );u_short pci_command;int err; - +if (!dev)return -ENOMEM ; +if (pci_enable_device (pdev)) {
_Obviously_ incomplete change. Look above, and see pci_resource_start()
Jeff
Quoted 13 lines · Jeff Garzik
Quoted 12 lines · Linux Kernel Mailing List
diff -Nru
a/drivers/net/hp100.cb/drivers/net/hp100.cdrivers/net/hp100.c +1
-1@@ -2910,10 +2910,15 @@int ioaddr =pci_resource_start (pdev,0 );u_short pci_command;int err; - +if (!dev)return -ENOMEM ;
Quoted 4 lines
drivers/net/hp100.c line 2917
Quoted 1 line
drivers/net/hp100.c +1
-0+if (pci_enable_device (pdev)) {_Obviously_ incomplete change. Look above, and see
pci_resource_start()
Thanks. Here's an additional patch to address this problem (again, compiled but not tested because I don't have the hardware):
Don't look at pci_resource_start() before pci_enable_device().
Signed-off-by Bjorn Helgaas <[email protected]>
===== drivers/net/hp100.c 1.29 vs edited =====
drivers/net/hp100.c +9 -8
@@ -2906,16 +2906,17 @@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 @@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 @@release_region (dev->base_addr,HP100_REGION_SIZE ); out1:free_netdev (dev); -pci_disable_device (pdev); out0: +pci_disable_device (pdev);return err; }