From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753015Ab1KFPA1 (ORCPT ); Sun, 6 Nov 2011 10:00:27 -0500 Received: from mail-fx0-f46.google.com ([209.85.161.46]:54130 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751957Ab1KFPA0 (ORCPT ); Sun, 6 Nov 2011 10:00:26 -0500 From: Jonas Gorski To: Greg Kroah-Hartman , Mark Einon Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] staging: et131x: fix build failure with PM_SLEEP disabled Date: Sun, 6 Nov 2011 15:59:22 +0100 Message-Id: <1320591562-11839-1-git-send-email-jonas.gorski@gmail.com> X-Mailer: git-send-email 1.7.2.5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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