Commit b200bfd6 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by David S. Miller

fm10k: mark PM functions as __maybe_unused

A cleanup of the PM code left an incorrect #ifdef in place, leading
to a harmless build warning:

drivers/net/ethernet/intel/fm10k/fm10k_pci.c:2502:12: error: 'fm10k_suspend' defined but not used [-Werror=unused-function]
drivers/net/ethernet/intel/fm10k/fm10k_pci.c:2475:12: error: 'fm10k_resume' defined but not used [-Werror=unused-function]

It's easier to use __maybe_unused attributes here, since you
can't pick the wrong one.

Fixes: 8249c47c ("fm10k: use generic PM hooks instead of legacy PCIe power hooks")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Tested-by: default avatarKrishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5762d7d3
...@@ -2463,7 +2463,6 @@ static int fm10k_handle_resume(struct fm10k_intfc *interface) ...@@ -2463,7 +2463,6 @@ static int fm10k_handle_resume(struct fm10k_intfc *interface)
return err; return err;
} }
#ifdef CONFIG_PM
/** /**
* fm10k_resume - Generic PM resume hook * fm10k_resume - Generic PM resume hook
* @dev: generic device structure * @dev: generic device structure
...@@ -2472,7 +2471,7 @@ static int fm10k_handle_resume(struct fm10k_intfc *interface) ...@@ -2472,7 +2471,7 @@ static int fm10k_handle_resume(struct fm10k_intfc *interface)
* suspend or hibernation. This function does not need to handle lower PCIe * suspend or hibernation. This function does not need to handle lower PCIe
* device state as the stack takes care of that for us. * device state as the stack takes care of that for us.
**/ **/
static int fm10k_resume(struct device *dev) static int __maybe_unused fm10k_resume(struct device *dev)
{ {
struct fm10k_intfc *interface = pci_get_drvdata(to_pci_dev(dev)); struct fm10k_intfc *interface = pci_get_drvdata(to_pci_dev(dev));
struct net_device *netdev = interface->netdev; struct net_device *netdev = interface->netdev;
...@@ -2499,7 +2498,7 @@ static int fm10k_resume(struct device *dev) ...@@ -2499,7 +2498,7 @@ static int fm10k_resume(struct device *dev)
* system suspend or hibernation. This function does not need to handle lower * system suspend or hibernation. This function does not need to handle lower
* PCIe device state as the stack takes care of that for us. * PCIe device state as the stack takes care of that for us.
**/ **/
static int fm10k_suspend(struct device *dev) static int __maybe_unused fm10k_suspend(struct device *dev)
{ {
struct fm10k_intfc *interface = pci_get_drvdata(to_pci_dev(dev)); struct fm10k_intfc *interface = pci_get_drvdata(to_pci_dev(dev));
struct net_device *netdev = interface->netdev; struct net_device *netdev = interface->netdev;
...@@ -2511,8 +2510,6 @@ static int fm10k_suspend(struct device *dev) ...@@ -2511,8 +2510,6 @@ static int fm10k_suspend(struct device *dev)
return 0; return 0;
} }
#endif /* CONFIG_PM */
/** /**
* fm10k_io_error_detected - called when PCI error is detected * fm10k_io_error_detected - called when PCI error is detected
* @pdev: Pointer to PCI device * @pdev: Pointer to PCI device
...@@ -2643,11 +2640,9 @@ static struct pci_driver fm10k_driver = { ...@@ -2643,11 +2640,9 @@ static struct pci_driver fm10k_driver = {
.id_table = fm10k_pci_tbl, .id_table = fm10k_pci_tbl,
.probe = fm10k_probe, .probe = fm10k_probe,
.remove = fm10k_remove, .remove = fm10k_remove,
#ifdef CONFIG_PM
.driver = { .driver = {
.pm = &fm10k_pm_ops, .pm = &fm10k_pm_ops,
}, },
#endif /* CONFIG_PM */
.sriov_configure = fm10k_iov_configure, .sriov_configure = fm10k_iov_configure,
.err_handler = &fm10k_err_handler .err_handler = &fm10k_err_handler
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment