summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorPhilipp Hortmann <philipp.g.hortmann@gmail.com>2023-06-08 09:52:18 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-06-15 13:47:06 +0300
commit4e9e2c8026ff200e818928f818dde17a311fed86 (patch)
treeefcef5eac78576f2fba75a2a5f1cb0e9ed0aefdd /drivers/staging
parentd88b46ce5ab8160a3c5d4efde27197d7545ec19a (diff)
downloadlinux-4e9e2c8026ff200e818928f818dde17a311fed86.tar.xz
staging: rtl8192e: Use standard api to calculate frequency to channel
Use ieee80211_freq_khz_to_channel() to calculate frequency to channel to omit proprietary code. Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Message-ID: <fc332e81f6677965e9e51f1fcef9815997effcb5.1686166624.git.philipp.g.hortmann@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/rtl8192e/rtllib_softmac_wx.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c
index 78a70e5f1974..6fd2e94d5f8a 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c
@@ -42,15 +42,8 @@ int rtllib_wx_set_freq(struct rtllib_device *ieee, struct iw_request_info *a,
if (fwrq->e == 1) {
if ((fwrq->m >= (int)2.412e8 &&
fwrq->m <= (int)2.487e8)) {
- int f = fwrq->m / 100000;
- int c = 0;
-
- while ((c < 14) && (f != rtllib_wlan_frequencies[c]))
- c++;
-
- /* hack to fall through */
+ fwrq->m = ieee80211_freq_khz_to_channel(fwrq->m / 100);
fwrq->e = 0;
- fwrq->m = c + 1;
}
}