wl12xx: fix compilation error when CONFIG_PM is not set
authorLuciano Coelho <coelho@ti.com>
Wed, 18 May 2011 20:51:26 +0000 (16:51 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 May 2011 20:51:26 +0000 (16:51 -0400)
There was a compilation error when PM is not enabled:

  CC [M]  drivers/net/wireless/wl12xx/main.o
drivers/net/wireless/wl12xx/main.c:3653: error: unknown field 'suspend' specified in initializer
drivers/net/wireless/wl12xx/main.c:3653: warning: initialization from incompatible pointer type
drivers/net/wireless/wl12xx/main.c:3654: error: unknown field 'resume' specified in initializer
drivers/net/wireless/wl12xx/main.c:3654: warning: initialization from incompatible pointer type

Fix this by adding #ifdef's in the appropriate places.

Cc: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wireless/wl12xx/main.c
drivers/net/wireless/wl12xx/sdio.c

index 610be03a198b99d05321502ee66e66963be184e8..bc00e52f6445daec57326299829eee976d62a4bf 100644 (file)
@@ -1350,6 +1350,7 @@ static struct notifier_block wl1271_dev_notifier = {
        .notifier_call = wl1271_dev_notify,
 };
 
+#ifdef CONFIG_PM
 static int wl1271_configure_suspend(struct wl1271 *wl)
 {
        int ret;
@@ -1493,6 +1494,7 @@ static int wl1271_op_resume(struct ieee80211_hw *hw)
 
        return 0;
 }
+#endif
 
 static int wl1271_op_start(struct ieee80211_hw *hw)
 {
@@ -3650,8 +3652,10 @@ static const struct ieee80211_ops wl1271_ops = {
        .stop = wl1271_op_stop,
        .add_interface = wl1271_op_add_interface,
        .remove_interface = wl1271_op_remove_interface,
+#ifdef CONFIG_PM
        .suspend = wl1271_op_suspend,
        .resume = wl1271_op_resume,
+#endif
        .config = wl1271_op_config,
        .prepare_multicast = wl1271_op_prepare_multicast,
        .configure_filter = wl1271_op_configure_filter,
index 92d29a860fc08566b6eab3220eae4392ce46e3e2..536e5065454b084cb5042f71f24e707bd8951ccf 100644 (file)
@@ -330,6 +330,7 @@ static void __devexit wl1271_remove(struct sdio_func *func)
        wl1271_free_hw(wl);
 }
 
+#ifdef CONFIG_PM
 static int wl1271_suspend(struct device *dev)
 {
        /* Tell MMC/SDIO core it's OK to power down the card
@@ -385,15 +386,18 @@ static const struct dev_pm_ops wl1271_sdio_pm_ops = {
        .suspend        = wl1271_suspend,
        .resume         = wl1271_resume,
 };
+#endif
 
 static struct sdio_driver wl1271_sdio_driver = {
        .name           = "wl1271_sdio",
        .id_table       = wl1271_devices,
        .probe          = wl1271_probe,
        .remove         = __devexit_p(wl1271_remove),
+#ifdef CONFIG_PM
        .drv = {
                .pm = &wl1271_sdio_pm_ops,
        },
+#endif
 };
 
 static int __init wl1271_init(void)