diff options
author | Jon Mason <jon.mason@exar.com> | 2010-11-30 18:43:26 -0500 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2010-12-23 15:53:09 -0500 |
commit | 1d3c16a818e992c199844954d95c17fd7ce6cbba (patch) | |
tree | 6f54b4153b8f7e54bdb5a8abc3ceffa7b4eec0e2 /drivers/net | |
parent | 2f671e2dbff6eb5ef4e2600adbec550c13b8fe72 (diff) |
PCI: make pci_restore_state return void
pci_restore_state only ever returns 0, thus there is no benefit in
having it return any value. Also, a large majority of the callers do
not check the return code of pci_restore_state. Make the
pci_restore_state a void return and avoid the overhead.
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Jon Mason <jon.mason@exar.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/myri10ge/myri10ge.c | 4 | ||||
-rw-r--r-- | drivers/net/sfc/falcon.c | 25 | ||||
-rw-r--r-- | drivers/net/skge.c | 4 | ||||
-rw-r--r-- | drivers/net/sky2.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00pci.c | 4 |
5 files changed, 10 insertions, 32 deletions
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index 8524cc40ec5..d3c4a374a92 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -3403,9 +3403,7 @@ static int myri10ge_resume(struct pci_dev *pdev) | |||
3403 | return -EIO; | 3403 | return -EIO; |
3404 | } | 3404 | } |
3405 | 3405 | ||
3406 | status = pci_restore_state(pdev); | 3406 | pci_restore_state(pdev); |
3407 | if (status) | ||
3408 | return status; | ||
3409 | 3407 | ||
3410 | status = pci_enable_device(pdev); | 3408 | status = pci_enable_device(pdev); |
3411 | if (status) { | 3409 | if (status) { |
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c index 267019bb2b1..1763b9a7fd8 100644 --- a/drivers/net/sfc/falcon.c +++ b/drivers/net/sfc/falcon.c | |||
@@ -1066,22 +1066,9 @@ static int falcon_reset_hw(struct efx_nic *efx, enum reset_type method) | |||
1066 | 1066 | ||
1067 | /* Restore PCI configuration if needed */ | 1067 | /* Restore PCI configuration if needed */ |
1068 | if (method == RESET_TYPE_WORLD) { | 1068 | if (method == RESET_TYPE_WORLD) { |
1069 | if (efx_nic_is_dual_func(efx)) { | 1069 | if (efx_nic_is_dual_func(efx)) |
1070 | rc = pci_restore_state(nic_data->pci_dev2); | 1070 | pci_restore_state(nic_data->pci_dev2); |
1071 | if (rc) { | 1071 | pci_restore_state(efx->pci_dev); |
1072 | netif_err(efx, drv, efx->net_dev, | ||
1073 | "failed to restore PCI config for " | ||
1074 | "the secondary function\n"); | ||
1075 | goto fail3; | ||
1076 | } | ||
1077 | } | ||
1078 | rc = pci_restore_state(efx->pci_dev); | ||
1079 | if (rc) { | ||
1080 | netif_err(efx, drv, efx->net_dev, | ||
1081 | "failed to restore PCI config for the " | ||
1082 | "primary function\n"); | ||
1083 | goto fail4; | ||
1084 | } | ||
1085 | netif_dbg(efx, drv, efx->net_dev, | 1072 | netif_dbg(efx, drv, efx->net_dev, |
1086 | "successfully restored PCI config\n"); | 1073 | "successfully restored PCI config\n"); |
1087 | } | 1074 | } |
@@ -1092,7 +1079,7 @@ static int falcon_reset_hw(struct efx_nic *efx, enum reset_type method) | |||
1092 | rc = -ETIMEDOUT; | 1079 | rc = -ETIMEDOUT; |
1093 | netif_err(efx, hw, efx->net_dev, | 1080 | netif_err(efx, hw, efx->net_dev, |
1094 | "timed out waiting for hardware reset\n"); | 1081 | "timed out waiting for hardware reset\n"); |
1095 | goto fail5; | 1082 | goto fail3; |
1096 | } | 1083 | } |
1097 | netif_dbg(efx, hw, efx->net_dev, "hardware reset complete\n"); | 1084 | netif_dbg(efx, hw, efx->net_dev, "hardware reset complete\n"); |
1098 | 1085 | ||
@@ -1100,11 +1087,9 @@ static int falcon_reset_hw(struct efx_nic *efx, enum reset_type method) | |||
1100 | 1087 | ||
1101 | /* pci_save_state() and pci_restore_state() MUST be called in pairs */ | 1088 | /* pci_save_state() and pci_restore_state() MUST be called in pairs */ |
1102 | fail2: | 1089 | fail2: |
1103 | fail3: | ||
1104 | pci_restore_state(efx->pci_dev); | 1090 | pci_restore_state(efx->pci_dev); |
1105 | fail1: | 1091 | fail1: |
1106 | fail4: | 1092 | fail3: |
1107 | fail5: | ||
1108 | return rc; | 1093 | return rc; |
1109 | } | 1094 | } |
1110 | 1095 | ||
diff --git a/drivers/net/skge.c b/drivers/net/skge.c index 220e0398f1d..61553af38e6 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c | |||
@@ -4087,9 +4087,7 @@ static int skge_resume(struct pci_dev *pdev) | |||
4087 | if (err) | 4087 | if (err) |
4088 | goto out; | 4088 | goto out; |
4089 | 4089 | ||
4090 | err = pci_restore_state(pdev); | 4090 | pci_restore_state(pdev); |
4091 | if (err) | ||
4092 | goto out; | ||
4093 | 4091 | ||
4094 | err = skge_reset(hw); | 4092 | err = skge_reset(hw); |
4095 | if (err) | 4093 | if (err) |
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index d6577084ce7..be3aee78276 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -4969,10 +4969,7 @@ static int sky2_resume(struct pci_dev *pdev) | |||
4969 | if (err) | 4969 | if (err) |
4970 | goto out; | 4970 | goto out; |
4971 | 4971 | ||
4972 | err = pci_restore_state(pdev); | 4972 | pci_restore_state(pdev); |
4973 | if (err) | ||
4974 | goto out; | ||
4975 | |||
4976 | pci_enable_wake(pdev, PCI_D0, 0); | 4973 | pci_enable_wake(pdev, PCI_D0, 0); |
4977 | 4974 | ||
4978 | /* Re-enable all clocks */ | 4975 | /* Re-enable all clocks */ |
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c index 2449d785cf8..4fd4c33de6a 100644 --- a/drivers/net/wireless/rt2x00/rt2x00pci.c +++ b/drivers/net/wireless/rt2x00/rt2x00pci.c | |||
@@ -356,12 +356,12 @@ int rt2x00pci_resume(struct pci_dev *pci_dev) | |||
356 | struct rt2x00_dev *rt2x00dev = hw->priv; | 356 | struct rt2x00_dev *rt2x00dev = hw->priv; |
357 | 357 | ||
358 | if (pci_set_power_state(pci_dev, PCI_D0) || | 358 | if (pci_set_power_state(pci_dev, PCI_D0) || |
359 | pci_enable_device(pci_dev) || | 359 | pci_enable_device(pci_dev)) { |
360 | pci_restore_state(pci_dev)) { | ||
361 | ERROR(rt2x00dev, "Failed to resume device.\n"); | 360 | ERROR(rt2x00dev, "Failed to resume device.\n"); |
362 | return -EIO; | 361 | return -EIO; |
363 | } | 362 | } |
364 | 363 | ||
364 | pci_restore_state(pci_dev); | ||
365 | return rt2x00lib_resume(rt2x00dev); | 365 | return rt2x00lib_resume(rt2x00dev); |
366 | } | 366 | } |
367 | EXPORT_SYMBOL_GPL(rt2x00pci_resume); | 367 | EXPORT_SYMBOL_GPL(rt2x00pci_resume); |