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

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

 



Le vendredi 31 dÃcembre 2010 Ã 11:14 -0800, David Miller a Ãcrit :
> From: "Rafael J. Wysocki" <rjw@xxxxxxx>
> Date: Sat, 25 Dec 2010 23:56:23 +0100
> 
> > From: Rafael J. Wysocki <rjw@xxxxxxx>
> > 
> > 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 <rjw@xxxxxxx>
> 
> 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 <eric.dumazet@xxxxxxxxx>
Cc: Rafael J. Wysocki <rjw@xxxxxxx>
Cc: Michael Chan <mchan@xxxxxxxxxxxx>
Cc: Matt Carlson <mcarlson@xxxxxxxxxxxx>
---
 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)


_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm



[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux