e1000e: fix the build error when PM is disabled
authorKevin Hao <haokexin@gmail.com>
Tue, 18 Mar 2014 07:26:49 +0000 (00:26 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Mar 2014 17:25:41 +0000 (13:25 -0400)
The commit 2800209994f8 (e1000e: Refactor PM flows) changed the
SET_SYSTEM_SLEEP_PM_OPS to open-coded assignment, but forgot to
protect them with CONFIG_PM_SLEEP. Then cause the following build
error when PM is disabled:
drivers/net/ethernet/intel/e1000e/netdev.c:7079:13:
error: 'e1000e_pm_suspend' undeclared here (not in a function)
  .suspend = e1000e_pm_suspend,
             ^
drivers/net/ethernet/intel/e1000e/netdev.c:7080:13:
error: 'e1000e_pm_resume' undeclared here (not in a function)
  .resume  = e1000e_pm_resume,
             ^
drivers/net/ethernet/intel/e1000e/netdev.c:7082:11:
error: 'e1000e_pm_thaw' undeclared here (not in a function)
  .thaw  = e1000e_pm_thaw,
           ^
Signed-off-by: Kevin Hao <haokexin@gmail.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/intel/e1000e/netdev.c

index 3f044e736de8d6b7b809a0d4cf8be1780540388f..eafad410e59a798fb127f6026a5bcd1722081c48 100644 (file)
@@ -7076,12 +7076,14 @@ static DEFINE_PCI_DEVICE_TABLE(e1000_pci_tbl) = {
 MODULE_DEVICE_TABLE(pci, e1000_pci_tbl);
 
 static const struct dev_pm_ops e1000_pm_ops = {
+#ifdef CONFIG_PM_SLEEP
        .suspend        = e1000e_pm_suspend,
        .resume         = e1000e_pm_resume,
        .freeze         = e1000e_pm_freeze,
        .thaw           = e1000e_pm_thaw,
        .poweroff       = e1000e_pm_suspend,
        .restore        = e1000e_pm_resume,
+#endif
        SET_RUNTIME_PM_OPS(e1000e_pm_runtime_suspend, e1000e_pm_runtime_resume,
                           e1000e_pm_runtime_idle)
 };