diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-09-11 10:17:11 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-09-14 14:09:25 +0200 |
commit | 5d8e4237d2dc73b51ac66dc612c5c42dd7424479 (patch) | |
tree | 7682e303361f1400abf693a465db672d864f227d /net/mac80211/util.c | |
parent | 04b7b2ff50fc77380c1e711f1d7223734547e41b (diff) | |
download | linux-5d8e4237d2dc73b51ac66dc612c5c42dd7424479.tar.bz2 |
mac80211: change locking around ieee80211_recalc_smps
Make the function acquire the necessary mutex itself
to simplify the callers.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r-- | net/mac80211/util.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 2017904c69cc..22ca35054dd0 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -1606,14 +1606,13 @@ static int check_mgd_smps(struct ieee80211_if_managed *ifmgd, return 0; } -/* must hold iflist_mtx */ void ieee80211_recalc_smps(struct ieee80211_local *local) { struct ieee80211_sub_if_data *sdata; enum ieee80211_smps_mode smps_mode = IEEE80211_SMPS_OFF; int count = 0; - lockdep_assert_held(&local->iflist_mtx); + mutex_lock(&local->iflist_mtx); /* * This function could be improved to handle multiple @@ -1642,12 +1641,14 @@ void ieee80211_recalc_smps(struct ieee80211_local *local) } if (smps_mode == local->smps_mode) - return; + goto unlock; set: local->smps_mode = smps_mode; /* changed flag is auto-detected for this */ ieee80211_hw_config(local, 0); + unlock: + mutex_unlock(&local->iflist_mtx); } static bool ieee80211_id_in_list(const u8 *ids, int n_ids, u8 id) |