diff options
author | Johannes Berg <johannes.berg@intel.com> | 2018-09-13 14:12:03 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2018-10-02 09:56:29 +0200 |
commit | e4d4216e91ea31049ba0cde0799ece244410a9f7 (patch) | |
tree | a456ffda4a9e63fa485fbbc63c3104e014f8e9da /net/wireless/nl80211.c | |
parent | a5ae326418b353301c6acc787a8988782e1762f6 (diff) | |
download | linux-e4d4216e91ea31049ba0cde0799ece244410a9f7.tar.bz2 |
cfg80211: combine duplicate wdev init code
There's a bit of duplicated code to initialize a wdev, pull it out
into a separate function to call from both places.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r-- | net/wireless/nl80211.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index b4908bcb0d77..0827cbdbb7b6 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -3252,15 +3252,7 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info) * P2P Device and NAN do not have a netdev, so don't go * through the netdev notifier and must be added here */ - mutex_init(&wdev->mtx); - INIT_LIST_HEAD(&wdev->event_list); - spin_lock_init(&wdev->event_lock); - INIT_LIST_HEAD(&wdev->mgmt_registrations); - spin_lock_init(&wdev->mgmt_registrations_lock); - - wdev->identifier = ++rdev->wdev_id; - list_add_rcu(&wdev->list, &rdev->wiphy.wdev_list); - rdev->devlist_generation++; + cfg80211_init_wdev(rdev, wdev); break; default: break; |