aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorValerie Henson <val_henson@linux.intel.com>2006-09-08 14:15:41 -0400
committerJeff Garzik <jeff@garzik.org>2006-09-11 09:05:37 -0400
commit9f486ae1d9ea700a952b77a8881de05ebc1610c3 (patch)
tree702247e52d2d8ce81758aec6dd3362db52a3cd36 /drivers/net
parent42eab56776b7c9686ee39f8f677a3e3b09caa170 (diff)
[PATCH] Handle pci_enable_device() errors in resume
Signed-off-by: Valerie Henson <val_henson@linux.intel.com> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/tulip/de2104x.c16
-rw-r--r--drivers/net/tulip/tulip_core.c5
-rw-r--r--drivers/net/tulip/winbond-840.c12
3 files changed, 22 insertions, 11 deletions
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
index 350a73e99a85..17a2ebaef58c 100644
--- a/drivers/net/tulip/de2104x.c
+++ b/drivers/net/tulip/de2104x.c
@@ -2138,17 +2138,21 @@ static int de_resume (struct pci_dev *pdev)
2138{ 2138{
2139 struct net_device *dev = pci_get_drvdata (pdev); 2139 struct net_device *dev = pci_get_drvdata (pdev);
2140 struct de_private *de = dev->priv; 2140 struct de_private *de = dev->priv;
2141 int retval = 0;
2141 2142
2142 rtnl_lock(); 2143 rtnl_lock();
2143 if (netif_device_present(dev)) 2144 if (netif_device_present(dev))
2144 goto out; 2145 goto out;
2145 if (netif_running(dev)) { 2146 if (!netif_running(dev))
2146 pci_enable_device(pdev); 2147 goto out_attach;
2147 de_init_hw(de); 2148 if ((retval = pci_enable_device(pdev))) {
2148 netif_device_attach(dev); 2149 printk (KERN_ERR "%s: pci_enable_device failed in resume\n",
2149 } else { 2150 dev->name);
2150 netif_device_attach(dev); 2151 goto out;
2151 } 2152 }
2153 de_init_hw(de);
2154out_attach:
2155 netif_device_attach(dev);
2152out: 2156out:
2153 rtnl_unlock(); 2157 rtnl_unlock();
2154 return 0; 2158 return 0;
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c
index def5999f987b..8092c4f8c036 100644
--- a/drivers/net/tulip/tulip_core.c
+++ b/drivers/net/tulip/tulip_core.c
@@ -1769,7 +1769,10 @@ static int tulip_resume(struct pci_dev *pdev)
1769 pci_set_power_state(pdev, PCI_D0); 1769 pci_set_power_state(pdev, PCI_D0);
1770 pci_restore_state(pdev); 1770 pci_restore_state(pdev);
1771 1771
1772 pci_enable_device(pdev); 1772 if ((retval = pci_enable_device(pdev))) {
1773 printk (KERN_ERR "tulip: pci_enable_device failed in resume\n");
1774 return retval;
1775 }
1773 1776
1774 if ((retval = request_irq(dev->irq, &tulip_interrupt, IRQF_SHARED, dev->name, dev))) { 1777 if ((retval = request_irq(dev->irq, &tulip_interrupt, IRQF_SHARED, dev->name, dev))) {
1775 printk (KERN_ERR "tulip: request_irq failed in resume\n"); 1778 printk (KERN_ERR "tulip: request_irq failed in resume\n");
diff --git a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c
index b54378fac8f0..a64d6828d9aa 100644
--- a/drivers/net/tulip/winbond-840.c
+++ b/drivers/net/tulip/winbond-840.c
@@ -1626,14 +1626,18 @@ static int w840_resume (struct pci_dev *pdev)
1626{ 1626{
1627 struct net_device *dev = pci_get_drvdata (pdev); 1627 struct net_device *dev = pci_get_drvdata (pdev);
1628 struct netdev_private *np = netdev_priv(dev); 1628 struct netdev_private *np = netdev_priv(dev);
1629 int retval = 0;
1629 1630
1630 rtnl_lock(); 1631 rtnl_lock();
1631 if (netif_device_present(dev)) 1632 if (netif_device_present(dev))
1632 goto out; /* device not suspended */ 1633 goto out; /* device not suspended */
1633 if (netif_running(dev)) { 1634 if (netif_running(dev)) {
1634 pci_enable_device(pdev); 1635 if ((retval = pci_enable_device(pdev))) {
1635 /* pci_power_on(pdev); */ 1636 printk (KERN_ERR
1636 1637 "%s: pci_enable_device failed in resume\n",
1638 dev->name);
1639 goto out;
1640 }
1637 spin_lock_irq(&np->lock); 1641 spin_lock_irq(&np->lock);
1638 iowrite32(1, np->base_addr+PCIBusCfg); 1642 iowrite32(1, np->base_addr+PCIBusCfg);
1639 ioread32(np->base_addr+PCIBusCfg); 1643 ioread32(np->base_addr+PCIBusCfg);
@@ -1651,7 +1655,7 @@ static int w840_resume (struct pci_dev *pdev)
1651 } 1655 }
1652out: 1656out:
1653 rtnl_unlock(); 1657 rtnl_unlock();
1654 return 0; 1658 return retval;
1655} 1659}
1656#endif 1660#endif
1657 1661