diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-12-03 12:56:41 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-01-03 07:01:24 -0500 |
commit | 11cff96c0660e1e361d60ab90514ffbbfbaf7c03 (patch) | |
tree | 134ab8c7bb898867d5b65157d303cbdca528461c /net | |
parent | fdc9d7b2863ce67f51ed64f89e5b20f3077be569 (diff) |
regulatory: simplify restore_regulatory_settings
Use list_splice_tail_init() and also simplify the locking.
Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/wireless/reg.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 57812dfc297b..87daba95639c 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -1878,9 +1878,6 @@ static void restore_regulatory_settings(bool reset_user) | |||
1878 | restore_custom_reg_settings(&rdev->wiphy); | 1878 | restore_custom_reg_settings(&rdev->wiphy); |
1879 | } | 1879 | } |
1880 | 1880 | ||
1881 | mutex_unlock(®_mutex); | ||
1882 | mutex_unlock(&cfg80211_mutex); | ||
1883 | |||
1884 | regulatory_hint_core(world_alpha2); | 1881 | regulatory_hint_core(world_alpha2); |
1885 | 1882 | ||
1886 | /* | 1883 | /* |
@@ -1891,18 +1888,8 @@ static void restore_regulatory_settings(bool reset_user) | |||
1891 | if (is_an_alpha2(alpha2)) | 1888 | if (is_an_alpha2(alpha2)) |
1892 | regulatory_hint_user(user_alpha2, NL80211_USER_REG_HINT_USER); | 1889 | regulatory_hint_user(user_alpha2, NL80211_USER_REG_HINT_USER); |
1893 | 1890 | ||
1894 | if (list_empty(&tmp_reg_req_list)) | ||
1895 | return; | ||
1896 | |||
1897 | mutex_lock(&cfg80211_mutex); | ||
1898 | mutex_lock(®_mutex); | ||
1899 | |||
1900 | spin_lock(®_requests_lock); | 1891 | spin_lock(®_requests_lock); |
1901 | list_for_each_entry_safe(reg_request, tmp, &tmp_reg_req_list, list) { | 1892 | list_splice_tail_init(&tmp_reg_req_list, ®_requests_list); |
1902 | REG_DBG_PRINT("Adding request for country %c%c back into the queue\n", | ||
1903 | reg_request->alpha2[0], reg_request->alpha2[1]); | ||
1904 | list_move_tail(®_request->list, ®_requests_list); | ||
1905 | } | ||
1906 | spin_unlock(®_requests_lock); | 1893 | spin_unlock(®_requests_lock); |
1907 | 1894 | ||
1908 | mutex_unlock(®_mutex); | 1895 | mutex_unlock(®_mutex); |