diff options
author | Mika Westerberg <mika.westerberg@linux.intel.com> | 2014-01-16 07:39:39 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-16 18:36:26 -0500 |
commit | 38a529b5d42e4cfc5ac94844e61335a00eb2d320 (patch) | |
tree | 8985f1c62427a55b415861860154d1dfedb4f241 /drivers/net/ethernet/intel/e1000e | |
parent | aee636c4809fa54848ff07a899b326eb1f9987a2 (diff) |
e1000e: Fix compilation warning when !CONFIG_PM_SLEEP
Commit 7509963c703b (e1000e: Fix a compile flag mis-match for
suspend/resume) moved suspend and resume hooks to be available when
CONFIG_PM is set. However, it can be set even if CONFIG_PM_SLEEP is not set
causing following warnings to be emitted:
drivers/net/ethernet/intel/e1000e/netdev.c:6178:12: warning:
‘e1000_suspend’ defined but not used [-Wunused-function]
drivers/net/ethernet/intel/e1000e/netdev.c:6185:12: warning:
‘e1000_resume’ defined but not used [-Wunused-function]
To fix this make the hooks to be available only when CONFIG_PM_SLEEP is set
and remove CONFIG_PM wrapping from driver ops because this is already
handled by SET_SYSTEM_SLEEP_PM_OPS() and SET_RUNTIME_PM_OPS().
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Dave Ertman <davidx.m.ertman@intel.com>
Cc: Aaron Brown <aaron.f.brown@intel.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/intel/e1000e')
-rw-r--r-- | drivers/net/ethernet/intel/e1000e/netdev.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index c30d41d6e426..6d14eea17918 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c | |||
@@ -6174,7 +6174,7 @@ static int __e1000_resume(struct pci_dev *pdev) | |||
6174 | return 0; | 6174 | return 0; |
6175 | } | 6175 | } |
6176 | 6176 | ||
6177 | #ifdef CONFIG_PM | 6177 | #ifdef CONFIG_PM_SLEEP |
6178 | static int e1000_suspend(struct device *dev) | 6178 | static int e1000_suspend(struct device *dev) |
6179 | { | 6179 | { |
6180 | struct pci_dev *pdev = to_pci_dev(dev); | 6180 | struct pci_dev *pdev = to_pci_dev(dev); |
@@ -6193,7 +6193,7 @@ static int e1000_resume(struct device *dev) | |||
6193 | 6193 | ||
6194 | return __e1000_resume(pdev); | 6194 | return __e1000_resume(pdev); |
6195 | } | 6195 | } |
6196 | #endif /* CONFIG_PM */ | 6196 | #endif /* CONFIG_PM_SLEEP */ |
6197 | 6197 | ||
6198 | #ifdef CONFIG_PM_RUNTIME | 6198 | #ifdef CONFIG_PM_RUNTIME |
6199 | static int e1000_runtime_suspend(struct device *dev) | 6199 | static int e1000_runtime_suspend(struct device *dev) |
@@ -7015,13 +7015,11 @@ static DEFINE_PCI_DEVICE_TABLE(e1000_pci_tbl) = { | |||
7015 | }; | 7015 | }; |
7016 | MODULE_DEVICE_TABLE(pci, e1000_pci_tbl); | 7016 | MODULE_DEVICE_TABLE(pci, e1000_pci_tbl); |
7017 | 7017 | ||
7018 | #ifdef CONFIG_PM | ||
7019 | static const struct dev_pm_ops e1000_pm_ops = { | 7018 | static const struct dev_pm_ops e1000_pm_ops = { |
7020 | SET_SYSTEM_SLEEP_PM_OPS(e1000_suspend, e1000_resume) | 7019 | SET_SYSTEM_SLEEP_PM_OPS(e1000_suspend, e1000_resume) |
7021 | SET_RUNTIME_PM_OPS(e1000_runtime_suspend, e1000_runtime_resume, | 7020 | SET_RUNTIME_PM_OPS(e1000_runtime_suspend, e1000_runtime_resume, |
7022 | e1000_idle) | 7021 | e1000_idle) |
7023 | }; | 7022 | }; |
7024 | #endif | ||
7025 | 7023 | ||
7026 | /* PCI Device API Driver */ | 7024 | /* PCI Device API Driver */ |
7027 | static struct pci_driver e1000_driver = { | 7025 | static struct pci_driver e1000_driver = { |
@@ -7029,11 +7027,9 @@ static struct pci_driver e1000_driver = { | |||
7029 | .id_table = e1000_pci_tbl, | 7027 | .id_table = e1000_pci_tbl, |
7030 | .probe = e1000_probe, | 7028 | .probe = e1000_probe, |
7031 | .remove = e1000_remove, | 7029 | .remove = e1000_remove, |
7032 | #ifdef CONFIG_PM | ||
7033 | .driver = { | 7030 | .driver = { |
7034 | .pm = &e1000_pm_ops, | 7031 | .pm = &e1000_pm_ops, |
7035 | }, | 7032 | }, |
7036 | #endif | ||
7037 | .shutdown = e1000_shutdown, | 7033 | .shutdown = e1000_shutdown, |
7038 | .err_handler = &e1000_err_handler | 7034 | .err_handler = &e1000_err_handler |
7039 | }; | 7035 | }; |