Skip to content

Commit

Permalink
regulatory: remove locking from wiphy_apply_custom_regulatory
Browse files Browse the repository at this point in the history
wiphy_apply_custom_regulatory() doesn't have to hold
the regulatory mutex as it only modifies the given
wiphy with the given regulatory domain, it doesn't
access any global regulatory data.

Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Johannes Berg committed Jan 3, 2013
1 parent e8da2bb commit 540f6f2
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions net/wireless/reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1225,8 +1225,6 @@ static void handle_channel_custom(struct wiphy *wiphy,
const struct ieee80211_power_rule *power_rule = NULL;
const struct ieee80211_freq_range *freq_range = NULL;

assert_reg_lock();

r = freq_reg_info_regd(wiphy, MHZ_TO_KHZ(chan->center_freq),
desired_bw_khz, &reg_rule, regd);

Expand Down Expand Up @@ -1271,14 +1269,12 @@ void wiphy_apply_custom_regulatory(struct wiphy *wiphy,
enum ieee80211_band band;
unsigned int bands_set = 0;

mutex_lock(&reg_mutex);
for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
if (!wiphy->bands[band])
continue;
handle_band_custom(wiphy, wiphy->bands[band], regd);
bands_set++;
}
mutex_unlock(&reg_mutex);

/*
* no point in calling this if it won't have any effect
Expand Down

0 comments on commit 540f6f2

Please sign in to comment.