Skip to content

Commit

Permalink
[netdrvr] eepro100, ne2k-pci: abort resume if pci_enable_device() fails
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Jeff Garzik committed Jul 17, 2007
1 parent f6c4286 commit cad1b9d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion drivers/net/eepro100.c
Original file line number Diff line number Diff line change
Expand Up @@ -2292,10 +2292,15 @@ static int eepro100_resume(struct pci_dev *pdev)
struct net_device *dev = pci_get_drvdata (pdev);
struct speedo_private *sp = netdev_priv(dev);
void __iomem *ioaddr = sp->regs;
int rc;

pci_set_power_state(pdev, PCI_D0);
pci_restore_state(pdev);
pci_enable_device(pdev);

rc = pci_enable_device(pdev);
if (rc)
return rc;

pci_set_master(pdev);

if (!netif_running(dev))
Expand Down
7 changes: 6 additions & 1 deletion drivers/net/ne2k-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,10 +669,15 @@ static int ne2k_pci_suspend (struct pci_dev *pdev, pm_message_t state)
static int ne2k_pci_resume (struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata (pdev);
int rc;

pci_set_power_state(pdev, 0);
pci_restore_state(pdev);
pci_enable_device(pdev);

rc = pci_enable_device(pdev);
if (rc)
return rc;

NS8390_init(dev, 1);
netif_device_attach(dev);

Expand Down

0 comments on commit cad1b9d

Please sign in to comment.