mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-18 06:50:08 +00:00
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>
This commit is contained in:
parent
fdc9d7b286
commit
11cff96c06
@ -1878,9 +1878,6 @@ static void restore_regulatory_settings(bool reset_user)
|
||||
restore_custom_reg_settings(&rdev->wiphy);
|
||||
}
|
||||
|
||||
mutex_unlock(®_mutex);
|
||||
mutex_unlock(&cfg80211_mutex);
|
||||
|
||||
regulatory_hint_core(world_alpha2);
|
||||
|
||||
/*
|
||||
@ -1891,18 +1888,8 @@ static void restore_regulatory_settings(bool reset_user)
|
||||
if (is_an_alpha2(alpha2))
|
||||
regulatory_hint_user(user_alpha2, NL80211_USER_REG_HINT_USER);
|
||||
|
||||
if (list_empty(&tmp_reg_req_list))
|
||||
return;
|
||||
|
||||
mutex_lock(&cfg80211_mutex);
|
||||
mutex_lock(®_mutex);
|
||||
|
||||
spin_lock(®_requests_lock);
|
||||
list_for_each_entry_safe(reg_request, tmp, &tmp_reg_req_list, list) {
|
||||
REG_DBG_PRINT("Adding request for country %c%c back into the queue\n",
|
||||
reg_request->alpha2[0], reg_request->alpha2[1]);
|
||||
list_move_tail(®_request->list, ®_requests_list);
|
||||
}
|
||||
list_splice_tail_init(&tmp_reg_req_list, ®_requests_list);
|
||||
spin_unlock(®_requests_lock);
|
||||
|
||||
mutex_unlock(®_mutex);
|
||||
|
Loading…
Reference in New Issue
Block a user