Skip to content

Commit f3b407f

Browse files
jmberglinvjw
authored andcommitted
wireless: remove cfg80211_reg_mutex
This mutex is wrong, we use cfg80211_drv_mutex (which should possibly be renamed to just cfg80211_mutex) everywhere except in one place, fix that and get rid of the extra mutex. Also get rid of a spurious regulatory_requests list definition. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: John W. Linville <[email protected]>
1 parent cf03268 commit f3b407f

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

net/wireless/core.c

+2-4
Original file line numberDiff line numberDiff line change
@@ -301,12 +301,10 @@ int wiphy_register(struct wiphy *wiphy)
301301
/* check and set up bitrates */
302302
ieee80211_set_bitrate_flags(wiphy);
303303

304+
mutex_lock(&cfg80211_drv_mutex);
305+
304306
/* set up regulatory info */
305-
mutex_lock(&cfg80211_reg_mutex);
306307
wiphy_update_regulatory(wiphy, REGDOM_SET_BY_CORE);
307-
mutex_unlock(&cfg80211_reg_mutex);
308-
309-
mutex_lock(&cfg80211_drv_mutex);
310308

311309
res = device_add(&drv->wiphy.dev);
312310
if (res)

net/wireless/reg.c

-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ struct regulatory_request {
5252
};
5353

5454
static LIST_HEAD(regulatory_requests);
55-
DEFINE_MUTEX(cfg80211_reg_mutex);
5655

5756
/* To trigger userspace events */
5857
static struct platform_device *reg_pdev;
@@ -63,8 +62,6 @@ static u32 supported_bandwidths[] = {
6362
MHZ_TO_KHZ(20),
6463
};
6564

66-
static struct list_head regulatory_requests;
67-
6865
/* Central wireless core regulatory domains, we only need two,
6966
* the current one and a world regulatory domain in case we have no
7067
* information to give us an alpha2 */

net/wireless/reg.h

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#ifndef __NET_WIRELESS_REG_H
22
#define __NET_WIRELESS_REG_H
33

4-
extern struct mutex cfg80211_reg_mutex;
54
bool is_world_regdom(const char *alpha2);
65
bool reg_is_valid_request(const char *alpha2);
76

0 commit comments

Comments
 (0)