diff options
author | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2006-01-12 19:51:28 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2006-01-17 07:48:04 -0500 |
commit | 240b1710f56b359685bc698e2a1473a2f3f2b8d7 (patch) | |
tree | 150d74c7d736bde01f18edfee510cbe868f4fb87 /drivers/net | |
parent | fb3d47d4c4cd79eeddd0ee1b470e157840dccf21 (diff) |
[PATCH] e1000: Added variable to handle return values for pci_enable_* functions
This was to fix compilation warnings. Also added log messages when pci_enable_* functions return with an error.
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 75cd6dfbaa37..8207db44b705 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -4382,6 +4382,7 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state) | |||
4382 | struct e1000_adapter *adapter = netdev_priv(netdev); | 4382 | struct e1000_adapter *adapter = netdev_priv(netdev); |
4383 | uint32_t ctrl, ctrl_ext, rctl, manc, status; | 4383 | uint32_t ctrl, ctrl_ext, rctl, manc, status; |
4384 | uint32_t wufc = adapter->wol; | 4384 | uint32_t wufc = adapter->wol; |
4385 | int retval = 0; | ||
4385 | 4386 | ||
4386 | netif_device_detach(netdev); | 4387 | netif_device_detach(netdev); |
4387 | 4388 | ||
@@ -4427,13 +4428,21 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state) | |||
4427 | 4428 | ||
4428 | E1000_WRITE_REG(&adapter->hw, WUC, E1000_WUC_PME_EN); | 4429 | E1000_WRITE_REG(&adapter->hw, WUC, E1000_WUC_PME_EN); |
4429 | E1000_WRITE_REG(&adapter->hw, WUFC, wufc); | 4430 | E1000_WRITE_REG(&adapter->hw, WUFC, wufc); |
4430 | pci_enable_wake(pdev, 3, 1); | 4431 | retval = pci_enable_wake(pdev, PCI_D3hot, 1); |
4431 | pci_enable_wake(pdev, 4, 1); /* 4 == D3 cold */ | 4432 | if (retval) |
4433 | DPRINTK(PROBE, ERR, "Error enabling D3 wake\n"); | ||
4434 | retval = pci_enable_wake(pdev, PCI_D3cold, 1); | ||
4435 | if (retval) | ||
4436 | DPRINTK(PROBE, ERR, "Error enabling D3 cold wake\n"); | ||
4432 | } else { | 4437 | } else { |
4433 | E1000_WRITE_REG(&adapter->hw, WUC, 0); | 4438 | E1000_WRITE_REG(&adapter->hw, WUC, 0); |
4434 | E1000_WRITE_REG(&adapter->hw, WUFC, 0); | 4439 | E1000_WRITE_REG(&adapter->hw, WUFC, 0); |
4435 | pci_enable_wake(pdev, 3, 0); | 4440 | retval = pci_enable_wake(pdev, PCI_D3hot, 0); |
4436 | pci_enable_wake(pdev, 4, 0); /* 4 == D3 cold */ | 4441 | if (retval) |
4442 | DPRINTK(PROBE, ERR, "Error enabling D3 wake\n"); | ||
4443 | retval = pci_enable_wake(pdev, PCI_D3cold, 0); /* 4 == D3 cold */ | ||
4444 | if (retval) | ||
4445 | DPRINTK(PROBE, ERR, "Error enabling D3 cold wake\n"); | ||
4437 | } | 4446 | } |
4438 | 4447 | ||
4439 | pci_save_state(pdev); | 4448 | pci_save_state(pdev); |
@@ -4444,8 +4453,12 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state) | |||
4444 | if(manc & E1000_MANC_SMBUS_EN) { | 4453 | if(manc & E1000_MANC_SMBUS_EN) { |
4445 | manc |= E1000_MANC_ARP_EN; | 4454 | manc |= E1000_MANC_ARP_EN; |
4446 | E1000_WRITE_REG(&adapter->hw, MANC, manc); | 4455 | E1000_WRITE_REG(&adapter->hw, MANC, manc); |
4447 | pci_enable_wake(pdev, 3, 1); | 4456 | retval = pci_enable_wake(pdev, PCI_D3hot, 1); |
4448 | pci_enable_wake(pdev, 4, 1); /* 4 == D3 cold */ | 4457 | if (retval) |
4458 | DPRINTK(PROBE, ERR, "Error enabling D3 wake\n"); | ||
4459 | retval = pci_enable_wake(pdev, PCI_D3cold, 1); | ||
4460 | if (retval) | ||
4461 | DPRINTK(PROBE, ERR, "Error enabling D3 cold wake\n"); | ||
4449 | } | 4462 | } |
4450 | } | 4463 | } |
4451 | 4464 | ||
@@ -4454,7 +4467,10 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state) | |||
4454 | e1000_release_hw_control(adapter); | 4467 | e1000_release_hw_control(adapter); |
4455 | 4468 | ||
4456 | pci_disable_device(pdev); | 4469 | pci_disable_device(pdev); |
4457 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); | 4470 | |
4471 | retval = pci_set_power_state(pdev, pci_choose_state(pdev, state)); | ||
4472 | if (retval) | ||
4473 | DPRINTK(PROBE, ERR, "Error in setting power state\n"); | ||
4458 | 4474 | ||
4459 | return 0; | 4475 | return 0; |
4460 | } | 4476 | } |
@@ -4464,15 +4480,21 @@ e1000_resume(struct pci_dev *pdev) | |||
4464 | { | 4480 | { |
4465 | struct net_device *netdev = pci_get_drvdata(pdev); | 4481 | struct net_device *netdev = pci_get_drvdata(pdev); |
4466 | struct e1000_adapter *adapter = netdev_priv(netdev); | 4482 | struct e1000_adapter *adapter = netdev_priv(netdev); |
4483 | int retval; | ||
4467 | uint32_t manc, ret_val; | 4484 | uint32_t manc, ret_val; |
4468 | 4485 | ||
4469 | pci_set_power_state(pdev, PCI_D0); | 4486 | retval = pci_set_power_state(pdev, PCI_D0); |
4470 | pci_restore_state(pdev); | 4487 | if (retval) |
4488 | DPRINTK(PROBE, ERR, "Error in setting power state\n"); | ||
4471 | ret_val = pci_enable_device(pdev); | 4489 | ret_val = pci_enable_device(pdev); |
4472 | pci_set_master(pdev); | 4490 | pci_set_master(pdev); |
4473 | 4491 | ||
4474 | pci_enable_wake(pdev, PCI_D3hot, 0); | 4492 | retval = pci_enable_wake(pdev, PCI_D3hot, 0); |
4475 | pci_enable_wake(pdev, PCI_D3cold, 0); | 4493 | if (retval) |
4494 | DPRINTK(PROBE, ERR, "Error enabling D3 wake\n"); | ||
4495 | retval = pci_enable_wake(pdev, PCI_D3cold, 0); | ||
4496 | if (retval) | ||
4497 | DPRINTK(PROBE, ERR, "Error enabling D3 cold wake\n"); | ||
4476 | 4498 | ||
4477 | e1000_reset(adapter); | 4499 | e1000_reset(adapter); |
4478 | E1000_WRITE_REG(&adapter->hw, WUS, ~0); | 4500 | E1000_WRITE_REG(&adapter->hw, WUS, ~0); |