From aa6027cacdd912ce884953714fcc7392b6155bc6 Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Sat, 1 Jan 2011 05:22:46 +0000 Subject: [PATCH] tg3: fix warnings MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Cc: Rafael J. Wysocki Cc: Michael Chan Cc: Matt Carlson Signed-off-by: David S. Miller --- drivers/net/tg3.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 6137869799a4..e3d80c9fb86f 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) -- 2.20.1