diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2008-11-12 17:21:56 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-11-25 16:41:22 -0500 |
commit | 5203cdb6ad430d3313444ddc6486da70af1a60db (patch) | |
tree | a9268a8b1c8768e36994e293d782987f20562e6f /net/wireless/reg.c | |
parent | 91e9900418fb01229094fb83befa3591afcae1e7 (diff) |
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.c | 43 |
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, | |||
698 | else if (r) | 698 | else if (r) |
699 | return r; | 699 | return r; |
700 | 700 | ||
701 | switch (set_by) { | 701 | request = kzalloc(sizeof(struct regulatory_request), |
702 | case REGDOM_SET_BY_CORE: | 702 | GFP_KERNEL); |
703 | case REGDOM_SET_BY_COUNTRY_IE: | 703 | if (!request) |
704 | case REGDOM_SET_BY_DRIVER: | 704 | return -ENOMEM; |
705 | case REGDOM_SET_BY_USER: | 705 | |
706 | request = kzalloc(sizeof(struct regulatory_request), | 706 | request->alpha2[0] = alpha2[0]; |
707 | GFP_KERNEL); | 707 | request->alpha2[1] = alpha2[1]; |
708 | if (!request) | 708 | request->initiator = set_by; |
709 | return -ENOMEM; | 709 | request->wiphy = wiphy; |
710 | 710 | request->intersect = intersect; | |
711 | request->alpha2[0] = alpha2[0]; | 711 | |
712 | request->alpha2[1] = alpha2[1]; | 712 | kfree(last_request); |
713 | request->initiator = set_by; | 713 | last_request = request; |
714 | request->wiphy = wiphy; | 714 | r = call_crda(alpha2); |
715 | request->intersect = intersect; | 715 | |
716 | |||
717 | kfree(last_request); | ||
718 | last_request = request; | ||
719 | r = call_crda(alpha2); | ||
720 | #ifndef CONFIG_WIRELESS_OLD_REGULATORY | 716 | #ifndef CONFIG_WIRELESS_OLD_REGULATORY |
721 | if (r) | 717 | if (r) |
722 | printk(KERN_ERR "cfg80211: Failed calling CRDA\n"); | 718 | printk(KERN_ERR "cfg80211: Failed calling CRDA\n"); |
723 | #endif | 719 | #endif |
724 | break; | ||
725 | default: | ||
726 | r = -ENOTSUPP; | ||
727 | break; | ||
728 | } | ||
729 | 720 | ||
730 | return r; | 721 | return r; |
731 | } | 722 | } |