summaryrefslogtreecommitdiff
path: root/net/wireless/reg.c
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2008-11-12 14:21:56 -0800
committerJohn W. Linville <linville@tuxdriver.com>2008-11-25 16:41:22 -0500
commit5203cdb6ad430d3313444ddc6486da70af1a60db (patch)
treea9268a8b1c8768e36994e293d782987f20562e6f /net/wireless/reg.c
parent91e9900418fb01229094fb83befa3591afcae1e7 (diff)
downloadlwn-5203cdb6ad430d3313444ddc6486da70af1a60db.tar.gz
lwn-5203cdb6ad430d3313444ddc6486da70af1a60db.zip
cfg80211: remove switch from __regulatory_hint()
We have complete control over REGDOM_SET_BY_* enum passed down to __regulatory_hint() as such there is no need to account for unexpected REGDOM_SET_BY_*'s, lets just remove the switch statement as this code does not change and won't change even when we add 802.11d support. This patch has no functional changes. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/reg.c')
-rw-r--r--net/wireless/reg.c43
1 files changed, 17 insertions, 26 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 7a2ce270f4d3..e44f0052687c 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -698,34 +698,25 @@ int __regulatory_hint(struct wiphy *wiphy, enum reg_set_by set_by,
else if (r)
return r;
- switch (set_by) {
- case REGDOM_SET_BY_CORE:
- case REGDOM_SET_BY_COUNTRY_IE:
- case REGDOM_SET_BY_DRIVER:
- case REGDOM_SET_BY_USER:
- request = kzalloc(sizeof(struct regulatory_request),
- GFP_KERNEL);
- if (!request)
- return -ENOMEM;
-
- request->alpha2[0] = alpha2[0];
- request->alpha2[1] = alpha2[1];
- request->initiator = set_by;
- request->wiphy = wiphy;
- request->intersect = intersect;
-
- kfree(last_request);
- last_request = request;
- r = call_crda(alpha2);
+ request = kzalloc(sizeof(struct regulatory_request),
+ GFP_KERNEL);
+ if (!request)
+ return -ENOMEM;
+
+ request->alpha2[0] = alpha2[0];
+ request->alpha2[1] = alpha2[1];
+ request->initiator = set_by;
+ request->wiphy = wiphy;
+ request->intersect = intersect;
+
+ kfree(last_request);
+ last_request = request;
+ r = call_crda(alpha2);
+
#ifndef CONFIG_WIRELESS_OLD_REGULATORY
- if (r)
- printk(KERN_ERR "cfg80211: Failed calling CRDA\n");
+ if (r)
+ printk(KERN_ERR "cfg80211: Failed calling CRDA\n");
#endif
- break;
- default:
- r = -ENOTSUPP;
- break;
- }
return r;
}