* [PATCH] staging: et131x: fix build failure with PM_SLEEP disabled
@ 2011-11-06 14:59 Jonas Gorski
[not found] ` <CANK3SE0Ehuytj2VCMiQbu+EHZqDZO7jBBaMb3AORVsC_DsSTVA@mail.gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Jonas Gorski @ 2011-11-06 14:59 UTC (permalink / raw)
To: Greg Kroah-Hartman, Mark Einon; +Cc: devel, linux-kernel
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] staging: et131x: fix build failure with PM_SLEEP disabled
[not found] ` <CANK3SE0Ehuytj2VCMiQbu+EHZqDZO7jBBaMb3AORVsC_DsSTVA@mail.gmail.com>
@ 2011-11-06 20:09 ` Jonas Gorski
2011-11-07 9:45 ` Mark Einon
0 siblings, 1 reply; 3+ messages in thread
From: Jonas Gorski @ 2011-11-06 20:09 UTC (permalink / raw)
To: Mark Einon; +Cc: devel, Greg Kroah-Hartman, linux-kernel
Hi Mark,
On 6 November 2011 19:47, Mark Einon <mark.einon@gmail.com> wrote:
> This issue has already been fixed by an earlier patch. See
> https://lkml.org/lkml/2011/11/4/245 .
Ah, great :-) So please disregard this patch. (Ah, I missed yours
since it seems to have gone only to LKLM, not to devel; at least I
don't see it in my local archive).
Regards,
Jonas
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] staging: et131x: fix build failure with PM_SLEEP disabled
2011-11-06 20:09 ` Jonas Gorski
@ 2011-11-07 9:45 ` Mark Einon
0 siblings, 0 replies; 3+ messages in thread
From: Mark Einon @ 2011-11-07 9:45 UTC (permalink / raw)
To: Jonas Gorski; +Cc: devel, Greg Kroah-Hartman, linux-kernel
On 6 November 2011 20:09, Jonas Gorski <jonas.gorski@gmail.com> wrote:
> Hi Mark,
>
> On 6 November 2011 19:47, Mark Einon <mark.einon@gmail.com> wrote:
>> This issue has already been fixed by an earlier patch. See
>> https://lkml.org/lkml/2011/11/4/245 .
>
> Ah, great :-) So please disregard this patch. (Ah, I missed yours
> since it seems to have gone only to LKLM, not to devel; at least I
> don't see it in my local archive).
Yes, you're right, I didn't send it to devel.
I believe there are other patches outstanding for et131x that mean
that this patch wouldn't apply.
I aim to look at fixing the staging tree in the next few days, unless
someone else gets there first.
cheers,
Mark
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-11-07 9:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-06 14:59 [PATCH] staging: et131x: fix build failure with PM_SLEEP disabled Jonas Gorski
[not found] ` <CANK3SE0Ehuytj2VCMiQbu+EHZqDZO7jBBaMb3AORVsC_DsSTVA@mail.gmail.com>
2011-11-06 20:09 ` Jonas Gorski
2011-11-07 9:45 ` Mark Einon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).