Thread (4 messages) 4 messages, 3 authors, 2011-01-01
STALE5639d

[PATCH net-next-2.6] tg3: fix warnings

From: Eric Dumazet <hidden>
Date: 2011-01-01 15:22:53
Subsystem: networking drivers, the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Le vendredi 31 décembre 2010 à 11:14 -0800, David Miller a écrit :
From: "Rafael J. Wysocki" <redacted>
Date: Sat, 25 Dec 2010 23:56:23 +0100
quoted
From: Rafael J. Wysocki <redacted>

The tg3 driver uses the legacy PCI power management, so it has to do
some PCI-specific things in its ->suspend() and ->resume() callbacks,
which isn't necessary and should better be done by the PCI
sybsystem-level power management code.

Convert tg3 to the new PCI power management framework and make it
let the PCI subsystem take care of all the PCI-specific aspects of
device handling during system power transitions.

Tested on HP nx6325 with a NetXtreme BCM5788 adapter.

Signed-off-by: Rafael J. Wysocki <redacted>
Applied.
Happy new year everybody ;)

Here is a followup to avoid some warnings if CONFIG_PM_SLEEP=n

Now I have to understand why vlan/bonding doesnt work anymore with tg3
on current net-next-2.6 :( 

Is anybody already on this problem ?
(Cc Jesse Gross)

Thanks

[PATCH net-next-2.6] tg3: fix warnings

In case CONFIG_PM_SLEEP is disabled, we dont need tg3_suspend() and
tg3_resume().

drivers/net/tg3.c:15056: warning: ‘tg3_suspend’ defined but not used
drivers/net/tg3.c:15110: warning: ‘tg3_resume’ defined but not used

Signed-off-by: Eric Dumazet <redacted>
Cc: Rafael J. Wysocki <redacted>
Cc: Michael Chan <mchan@broadcom.com>
Cc: Matt Carlson <redacted>
---
 drivers/net/tg3.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 6137869..e3d80c9 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -15052,6 +15052,7 @@ static void __devexit tg3_remove_one(struct pci_dev *pdev)
 	}
 }
 
+#ifdef CONFIG_PM_SLEEP
 static int tg3_suspend(struct device *device)
 {
 	struct pci_dev *pdev = to_pci_dev(device);
@@ -15140,13 +15141,20 @@ out:
 }
 
 static SIMPLE_DEV_PM_OPS(tg3_pm_ops, tg3_suspend, tg3_resume);
+#define TG3_PM_OPS (&tg3_pm_ops)
+
+#else
+
+#define TG3_PM_OPS NULL
+
+#endif /* CONFIG_PM_SLEEP */
 
 static struct pci_driver tg3_driver = {
 	.name		= DRV_MODULE_NAME,
 	.id_table	= tg3_pci_tbl,
 	.probe		= tg3_init_one,
 	.remove		= __devexit_p(tg3_remove_one),
-	.driver.pm	= &tg3_pm_ops,
+	.driver.pm	= TG3_PM_OPS,
 };
 
 static int __init tg3_init(void)

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help