From: Johannes Berg Back when we supported algorithm switching at runtime, this was needed for the open_count check. Now we don't have that any more, so the check and RTNL section can go away. Signed-off-by: Johannes Berg --- net/mac80211/main.c | 4 +--- net/mac80211/rate.c | 5 ----- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/net/mac80211/main.c b/net/mac80211/main.c index ad7dfc07ee63..28480f983932 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -1567,10 +1567,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) if (result) goto fail_flows; - rtnl_lock(); result = ieee80211_init_rate_ctrl_alg(local, hw->rate_control_algorithm); - rtnl_unlock(); if (result < 0) { wiphy_debug(local->hw.wiphy, "Failed to initialize rate control algorithm\n"); @@ -1689,9 +1687,9 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) fail_wiphy_register: fail_band: rtnl_lock(); - rate_control_deinitialize(local); ieee80211_remove_interfaces(local); rtnl_unlock(); + rate_control_deinitialize(local); fail_rate: ieee80211_txq_teardown_flows(local); fail_flows: diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c index f75257a19064..10e6ad537261 100644 --- a/net/mac80211/rate.c +++ b/net/mac80211/rate.c @@ -1001,11 +1001,6 @@ int ieee80211_init_rate_ctrl_alg(struct ieee80211_local *local, { struct rate_control_ref *ref; - ASSERT_RTNL(); - - if (local->open_count) - return -EBUSY; - if (ieee80211_hw_check(&local->hw, HAS_RATE_CONTROL)) { if (WARN_ON(!local->ops->set_rts_threshold)) return -EINVAL; -- 2.56.0