[PATCH] staging: et131x: fix build failure with PM_SLEEP disabled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The #ifdef CONFIG_PM_SLEEP for et131x_{suspend,resume} was also including
all functions below it, resulting in the following build failure when
PM_SLEEP is not enabled:

  CC [M]  drivers/staging/et131x/et131x.o
drivers/staging/et131x/et131x.c:5489:12: error: 'et131x_pci_setup' undeclared here (not in a function)
drivers/staging/et131x/et131x.c:4022:12: warning: 'et131x_pci_init' defined but not used
drivers/staging/et131x/et131x.c:4307:12: warning: 'et131x_mii_probe' defined but not used
drivers/staging/et131x/et131x.c:4355:31: warning: 'et131x_adapter_init' defined but not used
make[8]: *** [drivers/staging/et131x/et131x.o] Error 1

Fix this by moving et131x_{suspend,resume} to the ET131X_PM_OPS definition.

Signed-off-by: Jonas Gorski <jonas.gorski@xxxxxxxxx>
---
This patch is based on next-20111104 (which is identical to staging-next in
regard to et131x.c).

 drivers/staging/et131x/et131x.c |   58 +++++++++++++++++++-------------------
 1 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c
index f5f44a0..857588e 100644
--- a/drivers/staging/et131x/et131x.c
+++ b/drivers/staging/et131x/et131x.c
@@ -4440,35 +4440,6 @@ void et131x_down(struct net_device *netdev)
 	et131x_disable_txrx(netdev);
 }
 
-#ifdef CONFIG_PM_SLEEP
-static int et131x_suspend(struct device *dev)
-{
-	struct pci_dev *pdev = to_pci_dev(dev);
-	struct net_device *netdev = pci_get_drvdata(pdev);
-
-	if (netif_running(netdev)) {
-		netif_device_detach(netdev);
-		et131x_down(netdev);
-		pci_save_state(pdev);
-	}
-
-	return 0;
-}
-
-static int et131x_resume(struct device *dev)
-{
-	struct pci_dev *pdev = to_pci_dev(dev);
-	struct net_device *netdev = pci_get_drvdata(pdev);
-
-	if (netif_running(netdev)) {
-		pci_restore_state(pdev);
-		et131x_up(netdev);
-		netif_device_attach(netdev);
-	}
-
-	return 0;
-}
-
 /* ISR functions */
 
 /**
@@ -5470,6 +5441,35 @@ err_out:
 	return result;
 }
 
+#ifdef CONFIG_PM_SLEEP
+static int et131x_suspend(struct device *dev)
+{
+	struct pci_dev *pdev = to_pci_dev(dev);
+	struct net_device *netdev = pci_get_drvdata(pdev);
+
+	if (netif_running(netdev)) {
+		netif_device_detach(netdev);
+		et131x_down(netdev);
+		pci_save_state(pdev);
+	}
+
+	return 0;
+}
+
+static int et131x_resume(struct device *dev)
+{
+	struct pci_dev *pdev = to_pci_dev(dev);
+	struct net_device *netdev = pci_get_drvdata(pdev);
+
+	if (netif_running(netdev)) {
+		pci_restore_state(pdev);
+		et131x_up(netdev);
+		netif_device_attach(netdev);
+	}
+
+	return 0;
+}
+
 static SIMPLE_DEV_PM_OPS(et131x_pm_ops, et131x_suspend, et131x_resume);
 #define ET131X_PM_OPS (&et131x_pm_ops)
 #else
-- 
1.7.2.5

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux