From: Jonas Gorski <jonas.gorski@gmail.com>
To: Greg Kroah-Hartman <gregkh@suse.de>, Mark Einon <mark.einon@gmail.com>
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 [thread overview]
Message-ID: <1320591562-11839-1-git-send-email-jonas.gorski@gmail.com> (raw)
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@gmail.com>
---
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
next reply other threads:[~2011-11-06 15:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-06 14:59 Jonas Gorski [this message]
[not found] ` <CANK3SE0Ehuytj2VCMiQbu+EHZqDZO7jBBaMb3AORVsC_DsSTVA@mail.gmail.com>
2011-11-06 20:09 ` Jonas Gorski
2011-11-07 9:45 ` Mark Einon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1320591562-11839-1-git-send-email-jonas.gorski@gmail.com \
--to=jonas.gorski@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.einon@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®