aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-01-31 19:04:14 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-02-04 12:57:43 -0500
commit2ca813ad61136896c91a40194452ff665a522711 (patch)
treee1eb791203ddc573a8ac34a9fd0a836dcbc20132 /net/wireless
parent50521aa8817e3f6a77eb7aaabdbbb7b5c2fe0ea3 (diff)
cfg80211: move locking into cfg80211_bss_age
There's no reason for it to require external locking, move it into the function. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/scan.c3
-rw-r--r--net/wireless/sysfs.c2
2 files changed, 2 insertions, 3 deletions
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 34b47b30be88..1494d947e8dd 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -231,15 +231,16 @@ int __cfg80211_stop_sched_scan(struct cfg80211_registered_device *rdev,
231 return 0; 231 return 0;
232} 232}
233 233
234/* must hold dev->bss_lock! */
235void cfg80211_bss_age(struct cfg80211_registered_device *dev, 234void cfg80211_bss_age(struct cfg80211_registered_device *dev,
236 unsigned long age_secs) 235 unsigned long age_secs)
237{ 236{
238 struct cfg80211_internal_bss *bss; 237 struct cfg80211_internal_bss *bss;
239 unsigned long age_jiffies = msecs_to_jiffies(age_secs * MSEC_PER_SEC); 238 unsigned long age_jiffies = msecs_to_jiffies(age_secs * MSEC_PER_SEC);
240 239
240 spin_lock_bh(&dev->bss_lock);
241 list_for_each_entry(bss, &dev->bss_list, list) 241 list_for_each_entry(bss, &dev->bss_list, list)
242 bss->ts -= age_jiffies; 242 bss->ts -= age_jiffies;
243 spin_unlock_bh(&dev->bss_lock);
243} 244}
244 245
245void cfg80211_bss_expire(struct cfg80211_registered_device *dev) 246void cfg80211_bss_expire(struct cfg80211_registered_device *dev)
diff --git a/net/wireless/sysfs.c b/net/wireless/sysfs.c
index 9bf6d5e32166..73bf39f11314 100644
--- a/net/wireless/sysfs.c
+++ b/net/wireless/sysfs.c
@@ -108,9 +108,7 @@ static int wiphy_resume(struct device *dev)
108 int ret = 0; 108 int ret = 0;
109 109
110 /* Age scan results with time spent in suspend */ 110 /* Age scan results with time spent in suspend */
111 spin_lock_bh(&rdev->bss_lock);
112 cfg80211_bss_age(rdev, get_seconds() - rdev->suspend_at); 111 cfg80211_bss_age(rdev, get_seconds() - rdev->suspend_at);
113 spin_unlock_bh(&rdev->bss_lock);
114 112
115 if (rdev->ops->resume) { 113 if (rdev->ops->resume) {
116 rtnl_lock(); 114 rtnl_lock();