diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2013-05-29 22:22:05 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-05-30 14:42:47 -0400 |
commit | 4e17b87e792ed19e75a96eea618b90510265120c (patch) | |
tree | 4fffe1993ffd22606b5739a466ec8b4692510a01 /drivers | |
parent | b0a1ae976d6cd40ff90ba87883e17eb2610dae3d (diff) |
cw1200: Fix compile with CONFIG_PM=n
Intel's 0-day kernel build tester caught this build failure. This patch
properly wraps everything that depends on CONFIG_PM.
Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/cw1200/Makefile | 2 | ||||
-rw-r--r-- | drivers/net/wireless/cw1200/cw1200_sdio.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/cw1200/cw1200_spi.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/cw1200/main.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/cw1200/pm.h | 11 |
5 files changed, 27 insertions, 4 deletions
diff --git a/drivers/net/wireless/cw1200/Makefile b/drivers/net/wireless/cw1200/Makefile index c19737276be2..1aa3682066e0 100644 --- a/drivers/net/wireless/cw1200/Makefile +++ b/drivers/net/wireless/cw1200/Makefile | |||
@@ -8,9 +8,9 @@ cw1200_core-y := \ | |||
8 | wsm.o \ | 8 | wsm.o \ |
9 | sta.o \ | 9 | sta.o \ |
10 | scan.o \ | 10 | scan.o \ |
11 | pm.o \ | ||
12 | debug.o | 11 | debug.o |
13 | cw1200_core-$(CONFIG_CW1200_ITP) += itp.o | 12 | cw1200_core-$(CONFIG_CW1200_ITP) += itp.o |
13 | cw1200_core-$(CONFIG_PM) += pm.o | ||
14 | 14 | ||
15 | # CFLAGS_sta.o += -DDEBUG | 15 | # CFLAGS_sta.o += -DDEBUG |
16 | 16 | ||
diff --git a/drivers/net/wireless/cw1200/cw1200_sdio.c b/drivers/net/wireless/cw1200/cw1200_sdio.c index f6e22192d80a..2059a31815f3 100644 --- a/drivers/net/wireless/cw1200/cw1200_sdio.c +++ b/drivers/net/wireless/cw1200/cw1200_sdio.c | |||
@@ -334,6 +334,7 @@ static void cw1200_sdio_disconnect(struct sdio_func *func) | |||
334 | } | 334 | } |
335 | } | 335 | } |
336 | 336 | ||
337 | #ifdef CONFIG_PM | ||
337 | static int cw1200_sdio_suspend(struct device *dev) | 338 | static int cw1200_sdio_suspend(struct device *dev) |
338 | { | 339 | { |
339 | int ret; | 340 | int ret; |
@@ -360,15 +361,18 @@ static const struct dev_pm_ops cw1200_pm_ops = { | |||
360 | .suspend = cw1200_sdio_suspend, | 361 | .suspend = cw1200_sdio_suspend, |
361 | .resume = cw1200_sdio_resume, | 362 | .resume = cw1200_sdio_resume, |
362 | }; | 363 | }; |
364 | #endif | ||
363 | 365 | ||
364 | static struct sdio_driver sdio_driver = { | 366 | static struct sdio_driver sdio_driver = { |
365 | .name = "cw1200_wlan_sdio", | 367 | .name = "cw1200_wlan_sdio", |
366 | .id_table = cw1200_sdio_ids, | 368 | .id_table = cw1200_sdio_ids, |
367 | .probe = cw1200_sdio_probe, | 369 | .probe = cw1200_sdio_probe, |
368 | .remove = cw1200_sdio_disconnect, | 370 | .remove = cw1200_sdio_disconnect, |
371 | #ifdef CONFIG_PM | ||
369 | .drv = { | 372 | .drv = { |
370 | .pm = &cw1200_pm_ops, | 373 | .pm = &cw1200_pm_ops, |
371 | } | 374 | } |
375 | #endif | ||
372 | }; | 376 | }; |
373 | 377 | ||
374 | /* Init Module function -> Called by insmod */ | 378 | /* Init Module function -> Called by insmod */ |
diff --git a/drivers/net/wireless/cw1200/cw1200_spi.c b/drivers/net/wireless/cw1200/cw1200_spi.c index 04af68534854..b957d4a01c52 100644 --- a/drivers/net/wireless/cw1200/cw1200_spi.c +++ b/drivers/net/wireless/cw1200/cw1200_spi.c | |||
@@ -436,6 +436,7 @@ static int cw1200_spi_disconnect(struct spi_device *func) | |||
436 | return 0; | 436 | return 0; |
437 | } | 437 | } |
438 | 438 | ||
439 | #ifdef CONFIG_PM | ||
439 | static int cw1200_spi_suspend(struct device *dev, pm_message_t state) | 440 | static int cw1200_spi_suspend(struct device *dev, pm_message_t state) |
440 | { | 441 | { |
441 | struct sbus_priv *self = spi_get_drvdata(to_spi_device(dev)); | 442 | struct sbus_priv *self = spi_get_drvdata(to_spi_device(dev)); |
@@ -451,6 +452,7 @@ static int cw1200_spi_resume(struct device *dev) | |||
451 | { | 452 | { |
452 | return 0; | 453 | return 0; |
453 | } | 454 | } |
455 | #endif | ||
454 | 456 | ||
455 | static struct spi_driver spi_driver = { | 457 | static struct spi_driver spi_driver = { |
456 | .probe = cw1200_spi_probe, | 458 | .probe = cw1200_spi_probe, |
@@ -459,8 +461,10 @@ static struct spi_driver spi_driver = { | |||
459 | .name = "cw1200_wlan_spi", | 461 | .name = "cw1200_wlan_spi", |
460 | .bus = &spi_bus_type, | 462 | .bus = &spi_bus_type, |
461 | .owner = THIS_MODULE, | 463 | .owner = THIS_MODULE, |
464 | #ifdef CONFIG_PM | ||
462 | .suspend = cw1200_spi_suspend, | 465 | .suspend = cw1200_spi_suspend, |
463 | .resume = cw1200_spi_resume, | 466 | .resume = cw1200_spi_resume, |
467 | #endif | ||
464 | }, | 468 | }, |
465 | }; | 469 | }; |
466 | 470 | ||
diff --git a/drivers/net/wireless/cw1200/main.c b/drivers/net/wireless/cw1200/main.c index 8426d3d7607e..ef4b0b915f87 100644 --- a/drivers/net/wireless/cw1200/main.c +++ b/drivers/net/wireless/cw1200/main.c | |||
@@ -234,8 +234,10 @@ static const struct ieee80211_ops cw1200_ops = { | |||
234 | .get_stats = cw1200_get_stats, | 234 | .get_stats = cw1200_get_stats, |
235 | .ampdu_action = cw1200_ampdu_action, | 235 | .ampdu_action = cw1200_ampdu_action, |
236 | .flush = cw1200_flush, | 236 | .flush = cw1200_flush, |
237 | #ifdef CONFIG_PM | ||
237 | .suspend = cw1200_wow_suspend, | 238 | .suspend = cw1200_wow_suspend, |
238 | .resume = cw1200_wow_resume, | 239 | .resume = cw1200_wow_resume, |
240 | #endif | ||
239 | /* Intentionally not offloaded: */ | 241 | /* Intentionally not offloaded: */ |
240 | /*.channel_switch = cw1200_channel_switch, */ | 242 | /*.channel_switch = cw1200_channel_switch, */ |
241 | /*.remain_on_channel = cw1200_remain_on_channel, */ | 243 | /*.remain_on_channel = cw1200_remain_on_channel, */ |
@@ -292,10 +294,12 @@ static struct ieee80211_hw *cw1200_init_common(const u8 *macaddr, | |||
292 | BIT(NL80211_IFTYPE_P2P_CLIENT) | | 294 | BIT(NL80211_IFTYPE_P2P_CLIENT) | |
293 | BIT(NL80211_IFTYPE_P2P_GO); | 295 | BIT(NL80211_IFTYPE_P2P_GO); |
294 | 296 | ||
297 | #ifdef CONFIG_PM | ||
295 | /* Support only for limited wowlan functionalities */ | 298 | /* Support only for limited wowlan functionalities */ |
296 | hw->wiphy->wowlan.flags = WIPHY_WOWLAN_ANY | | 299 | hw->wiphy->wowlan.flags = WIPHY_WOWLAN_ANY | |
297 | WIPHY_WOWLAN_DISCONNECT; | 300 | WIPHY_WOWLAN_DISCONNECT; |
298 | hw->wiphy->wowlan.n_patterns = 0; | 301 | hw->wiphy->wowlan.n_patterns = 0; |
302 | #endif | ||
299 | 303 | ||
300 | hw->wiphy->flags |= WIPHY_FLAG_AP_UAPSD; | 304 | hw->wiphy->flags |= WIPHY_FLAG_AP_UAPSD; |
301 | 305 | ||
@@ -419,18 +423,22 @@ static int cw1200_register_common(struct ieee80211_hw *dev) | |||
419 | goto done; | 423 | goto done; |
420 | #endif | 424 | #endif |
421 | 425 | ||
426 | #ifdef CONFIG_PM | ||
422 | err = cw1200_pm_init(&priv->pm_state, priv); | 427 | err = cw1200_pm_init(&priv->pm_state, priv); |
423 | if (err) { | 428 | if (err) { |
424 | pr_err("Cannot init PM. (%d).\n", | 429 | pr_err("Cannot init PM. (%d).\n", |
425 | err); | 430 | err); |
426 | return err; | 431 | return err; |
427 | } | 432 | } |
433 | #endif | ||
428 | 434 | ||
429 | err = ieee80211_register_hw(dev); | 435 | err = ieee80211_register_hw(dev); |
430 | if (err) { | 436 | if (err) { |
431 | pr_err("Cannot register device (%d).\n", | 437 | pr_err("Cannot register device (%d).\n", |
432 | err); | 438 | err); |
439 | #ifdef CONFIG_PM | ||
433 | cw1200_pm_deinit(&priv->pm_state); | 440 | cw1200_pm_deinit(&priv->pm_state); |
441 | #endif | ||
434 | return err; | 442 | return err; |
435 | } | 443 | } |
436 | 444 | ||
@@ -482,7 +490,9 @@ static void cw1200_unregister_common(struct ieee80211_hw *dev) | |||
482 | cw1200_queue_deinit(&priv->tx_queue[i]); | 490 | cw1200_queue_deinit(&priv->tx_queue[i]); |
483 | 491 | ||
484 | cw1200_queue_stats_deinit(&priv->tx_queue_stats); | 492 | cw1200_queue_stats_deinit(&priv->tx_queue_stats); |
493 | #ifdef CONFIG_PM | ||
485 | cw1200_pm_deinit(&priv->pm_state); | 494 | cw1200_pm_deinit(&priv->pm_state); |
495 | #endif | ||
486 | } | 496 | } |
487 | 497 | ||
488 | /* Clock is in KHz */ | 498 | /* Clock is in KHz */ |
diff --git a/drivers/net/wireless/cw1200/pm.h b/drivers/net/wireless/cw1200/pm.h index 516d9671dd1e..3ed90ff22bb8 100644 --- a/drivers/net/wireless/cw1200/pm.h +++ b/drivers/net/wireless/cw1200/pm.h | |||
@@ -25,14 +25,19 @@ struct cw1200_pm_state { | |||
25 | spinlock_t lock; /* Protect access */ | 25 | spinlock_t lock; /* Protect access */ |
26 | }; | 26 | }; |
27 | 27 | ||
28 | #ifdef CONFIG_PM | ||
28 | int cw1200_pm_init(struct cw1200_pm_state *pm, | 29 | int cw1200_pm_init(struct cw1200_pm_state *pm, |
29 | struct cw1200_common *priv); | 30 | struct cw1200_common *priv); |
30 | void cw1200_pm_deinit(struct cw1200_pm_state *pm); | 31 | void cw1200_pm_deinit(struct cw1200_pm_state *pm); |
31 | void cw1200_pm_stay_awake(struct cw1200_pm_state *pm, | ||
32 | unsigned long tmo); | ||
33 | int cw1200_wow_suspend(struct ieee80211_hw *hw, | 32 | int cw1200_wow_suspend(struct ieee80211_hw *hw, |
34 | struct cfg80211_wowlan *wowlan); | 33 | struct cfg80211_wowlan *wowlan); |
35 | int cw1200_wow_resume(struct ieee80211_hw *hw); | 34 | int cw1200_wow_resume(struct ieee80211_hw *hw); |
36 | int cw1200_can_suspend(struct cw1200_common *priv); | 35 | int cw1200_can_suspend(struct cw1200_common *priv); |
37 | 36 | void cw1200_pm_stay_awake(struct cw1200_pm_state *pm, | |
37 | unsigned long tmo); | ||
38 | #else | ||
39 | static inline void cw1200_pm_stay_awake(struct cw1200_pm_state *pm, | ||
40 | unsigned long tmo) { | ||
41 | } | ||
42 | #endif | ||
38 | #endif | 43 | #endif |