Commit 6c507cd0400cb51dd2ee251c1b8756b9375a1128
Committed by
John W. Linville
1 parent
7d57961183
Exists in
master
and in
7 other branches
cfg80211: don't export ieee80211_get_channel
This patch makes ieee80211_get_channel a static inline defined in cfg80211's header file which simply calls __ieee80211_get_channel to avoid symbol clashes with the ieee80211 code. The problem was pointed out by David Miller, thanks! Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Cc: David Miller <davem@davemloft.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Showing 2 changed files with 18 additions and 6 deletions Side-by-side Diff
include/net/wireless.h
... | ... | @@ -304,11 +304,23 @@ |
304 | 304 | */ |
305 | 305 | extern int ieee80211_frequency_to_channel(int freq); |
306 | 306 | |
307 | +/* | |
308 | + * Name indirection necessary because the ieee80211 code also has | |
309 | + * a function named "ieee80211_get_channel", so if you include | |
310 | + * cfg80211's header file you get cfg80211's version, if you try | |
311 | + * to include both header files you'll (rightfully!) get a symbol | |
312 | + * clash. | |
313 | + */ | |
314 | +extern struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy, | |
315 | + int freq); | |
316 | + | |
307 | 317 | /** |
308 | 318 | * ieee80211_get_channel - get channel struct from wiphy for specified frequency |
309 | 319 | */ |
310 | -extern struct ieee80211_channel *ieee80211_get_channel(struct wiphy *wiphy, | |
311 | - int freq); | |
312 | - | |
320 | +static inline struct ieee80211_channel * | |
321 | +ieee80211_get_channel(struct wiphy *wiphy, int freq) | |
322 | +{ | |
323 | + return __ieee80211_get_channel(wiphy, freq); | |
324 | +} | |
313 | 325 | #endif /* __NET_WIRELESS_H */ |
net/wireless/util.c
... | ... | @@ -33,8 +33,8 @@ |
33 | 33 | } |
34 | 34 | EXPORT_SYMBOL(ieee80211_frequency_to_channel); |
35 | 35 | |
36 | -struct ieee80211_channel *ieee80211_get_channel(struct wiphy *wiphy, | |
37 | - int freq) | |
36 | +struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy, | |
37 | + int freq) | |
38 | 38 | { |
39 | 39 | enum ieee80211_band band; |
40 | 40 | struct ieee80211_supported_band *sband; |
... | ... | @@ -54,7 +54,7 @@ |
54 | 54 | |
55 | 55 | return NULL; |
56 | 56 | } |
57 | -EXPORT_SYMBOL(ieee80211_get_channel); | |
57 | +EXPORT_SYMBOL(__ieee80211_get_channel); | |
58 | 58 | |
59 | 59 | static void set_mandatory_flags_band(struct ieee80211_supported_band *sband, |
60 | 60 | enum ieee80211_band band) |