diff options
author | Johannes Berg <johannes.berg@intel.com> | 2011-09-15 14:46:45 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-09-19 16:10:09 -0400 |
commit | c01a404756ef7dd4089b3d5d2010cba99732e385 (patch) | |
tree | a971c8eb1a2391141fab46469463bfbc63b5e54c /drivers | |
parent | 72afb108ad679f0694d3232ffdd34b0e906773ef (diff) |
iwlagn: clean up PM code
The transport callbacks might as well be undefined
when CONFIG_PM_SLEEP is not set, so ifdef all of
it out and make everything available for PM_SLEEP
only.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | 14 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans.h | 5 |
3 files changed, 11 insertions, 14 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 61f8ea6413c0..5c85133219e6 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -1919,7 +1919,7 @@ static void iwlagn_mac_stop(struct ieee80211_hw *hw) | |||
1919 | IWL_DEBUG_MAC80211(priv, "leave\n"); | 1919 | IWL_DEBUG_MAC80211(priv, "leave\n"); |
1920 | } | 1920 | } |
1921 | 1921 | ||
1922 | #ifdef CONFIG_PM | 1922 | #ifdef CONFIG_PM_SLEEP |
1923 | static int iwlagn_send_patterns(struct iwl_priv *priv, | 1923 | static int iwlagn_send_patterns(struct iwl_priv *priv, |
1924 | struct cfg80211_wowlan *wowlan) | 1924 | struct cfg80211_wowlan *wowlan) |
1925 | { | 1925 | { |
@@ -1994,7 +1994,7 @@ struct wowlan_key_data { | |||
1994 | bool error, use_rsc_tsc, use_tkip; | 1994 | bool error, use_rsc_tsc, use_tkip; |
1995 | }; | 1995 | }; |
1996 | 1996 | ||
1997 | #ifdef CONFIG_PM | 1997 | #ifdef CONFIG_PM_SLEEP |
1998 | static void iwlagn_convert_p1k(u16 *p1k, __le16 *out) | 1998 | static void iwlagn_convert_p1k(u16 *p1k, __le16 *out) |
1999 | { | 1999 | { |
2000 | int i; | 2000 | int i; |
@@ -3203,7 +3203,7 @@ struct ieee80211_ops iwlagn_hw_ops = { | |||
3203 | .tx = iwlagn_mac_tx, | 3203 | .tx = iwlagn_mac_tx, |
3204 | .start = iwlagn_mac_start, | 3204 | .start = iwlagn_mac_start, |
3205 | .stop = iwlagn_mac_stop, | 3205 | .stop = iwlagn_mac_stop, |
3206 | #ifdef CONFIG_PM | 3206 | #ifdef CONFIG_PM_SLEEP |
3207 | .suspend = iwlagn_mac_suspend, | 3207 | .suspend = iwlagn_mac_suspend, |
3208 | .resume = iwlagn_mac_resume, | 3208 | .resume = iwlagn_mac_resume, |
3209 | #endif | 3209 | #endif |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c index de081194e300..ca13eebbdb4f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c +++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | |||
@@ -1363,8 +1363,7 @@ static void iwl_trans_pcie_free(struct iwl_trans *trans) | |||
1363 | kfree(trans); | 1363 | kfree(trans); |
1364 | } | 1364 | } |
1365 | 1365 | ||
1366 | #ifdef CONFIG_PM | 1366 | #ifdef CONFIG_PM_SLEEP |
1367 | |||
1368 | static int iwl_trans_pcie_suspend(struct iwl_trans *trans) | 1367 | static int iwl_trans_pcie_suspend(struct iwl_trans *trans) |
1369 | { | 1368 | { |
1370 | /* | 1369 | /* |
@@ -1402,14 +1401,7 @@ static int iwl_trans_pcie_resume(struct iwl_trans *trans) | |||
1402 | 1401 | ||
1403 | return 0; | 1402 | return 0; |
1404 | } | 1403 | } |
1405 | #else /* CONFIG_PM */ | 1404 | #endif /* CONFIG_PM_SLEEP */ |
1406 | static int iwl_trans_pcie_suspend(struct iwl_trans *trans) | ||
1407 | { return 0; } | ||
1408 | |||
1409 | static int iwl_trans_pcie_resume(struct iwl_trans *trans) | ||
1410 | { return 0; } | ||
1411 | |||
1412 | #endif /* CONFIG_PM */ | ||
1413 | 1405 | ||
1414 | static void iwl_trans_pcie_wake_any_queue(struct iwl_trans *trans, | 1406 | static void iwl_trans_pcie_wake_any_queue(struct iwl_trans *trans, |
1415 | enum iwl_rxon_context_id ctx) | 1407 | enum iwl_rxon_context_id ctx) |
@@ -1989,6 +1981,8 @@ const struct iwl_trans_ops trans_ops_pcie = { | |||
1989 | .wait_tx_queue_empty = iwl_trans_pcie_wait_tx_queue_empty, | 1981 | .wait_tx_queue_empty = iwl_trans_pcie_wait_tx_queue_empty, |
1990 | .check_stuck_queue = iwl_trans_pcie_check_stuck_queue, | 1982 | .check_stuck_queue = iwl_trans_pcie_check_stuck_queue, |
1991 | 1983 | ||
1984 | #ifdef CONFIG_PM_SLEEP | ||
1992 | .suspend = iwl_trans_pcie_suspend, | 1985 | .suspend = iwl_trans_pcie_suspend, |
1993 | .resume = iwl_trans_pcie_resume, | 1986 | .resume = iwl_trans_pcie_resume, |
1987 | #endif | ||
1994 | }; | 1988 | }; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h index 8fba5162e2dc..5b6e6842d5fc 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/iwlwifi/iwl-trans.h | |||
@@ -208,9 +208,10 @@ struct iwl_trans_ops { | |||
208 | int (*dbgfs_register)(struct iwl_trans *trans, struct dentry* dir); | 208 | int (*dbgfs_register)(struct iwl_trans *trans, struct dentry* dir); |
209 | int (*check_stuck_queue)(struct iwl_trans *trans, int q); | 209 | int (*check_stuck_queue)(struct iwl_trans *trans, int q); |
210 | int (*wait_tx_queue_empty)(struct iwl_trans *trans); | 210 | int (*wait_tx_queue_empty)(struct iwl_trans *trans); |
211 | 211 | #ifdef CONFIG_PM_SLEEP | |
212 | int (*suspend)(struct iwl_trans *trans); | 212 | int (*suspend)(struct iwl_trans *trans); |
213 | int (*resume)(struct iwl_trans *trans); | 213 | int (*resume)(struct iwl_trans *trans); |
214 | #endif | ||
214 | }; | 215 | }; |
215 | 216 | ||
216 | /** | 217 | /** |
@@ -337,6 +338,7 @@ static inline int iwl_trans_dbgfs_register(struct iwl_trans *trans, | |||
337 | return trans->ops->dbgfs_register(trans, dir); | 338 | return trans->ops->dbgfs_register(trans, dir); |
338 | } | 339 | } |
339 | 340 | ||
341 | #ifdef CONFIG_PM_SLEEP | ||
340 | static inline int iwl_trans_suspend(struct iwl_trans *trans) | 342 | static inline int iwl_trans_suspend(struct iwl_trans *trans) |
341 | { | 343 | { |
342 | return trans->ops->suspend(trans); | 344 | return trans->ops->suspend(trans); |
@@ -346,6 +348,7 @@ static inline int iwl_trans_resume(struct iwl_trans *trans) | |||
346 | { | 348 | { |
347 | return trans->ops->resume(trans); | 349 | return trans->ops->resume(trans); |
348 | } | 350 | } |
351 | #endif | ||
349 | 352 | ||
350 | /***************************************************** | 353 | /***************************************************** |
351 | * Transport layers implementations | 354 | * Transport layers implementations |