staging: wfx: hif_scan() never fails
authorJérôme Pouiller <jerome.pouiller@silabs.com>
Tue, 17 Dec 2019 16:15:28 +0000 (16:15 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Dec 2019 14:56:25 +0000 (15:56 +0100)
If scan fails, status is returned in hif_ind_scan_cmpl. hif_scan
always return a success. So, we can simplify the code.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191217161318.31402-45-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wfx/scan.c
drivers/staging/wfx/scan.h

index 4b95e6a..cdccb67 100644 (file)
@@ -36,7 +36,6 @@ static void wfx_scan_restart_delayed(struct wfx_vif *wvif)
 
 static int wfx_scan_start(struct wfx_vif *wvif, struct wfx_scan_params *scan)
 {
-       int ret;
        int tmo = 500;
 
        if (wvif->state == WFX_STATE_PRE_STA)
@@ -48,15 +47,8 @@ static int wfx_scan_start(struct wfx_vif *wvif, struct wfx_scan_params *scan)
        atomic_set(&wvif->wdev->scan_in_progress, 1);
 
        schedule_delayed_work(&wvif->scan.timeout, msecs_to_jiffies(tmo));
-       ret = hif_scan(wvif, scan);
-       if (ret) {
-               wfx_scan_failed_cb(wvif);
-               atomic_set(&wvif->scan.in_progress, 0);
-               atomic_set(&wvif->wdev->scan_in_progress, 0);
-               cancel_delayed_work_sync(&wvif->scan.timeout);
-               wfx_scan_restart_delayed(wvif);
-       }
-       return ret;
+       hif_scan(wvif, scan);
+       return 0;
 }
 
 int wfx_hw_scan(struct ieee80211_hw *hw,
@@ -245,14 +237,6 @@ static void wfx_scan_complete(struct wfx_vif *wvif)
        wfx_scan_work(&wvif->scan.work);
 }
 
-void wfx_scan_failed_cb(struct wfx_vif *wvif)
-{
-       if (cancel_delayed_work_sync(&wvif->scan.timeout) > 0) {
-               wvif->scan.status = -EIO;
-               schedule_work(&wvif->scan.timeout.work);
-       }
-}
-
 void wfx_scan_complete_cb(struct wfx_vif *wvif,
                          const struct hif_ind_scan_cmpl *arg)
 {
index c7c0ab1..e71e5f0 100644 (file)
@@ -38,6 +38,5 @@ void wfx_scan_work(struct work_struct *work);
 void wfx_scan_timeout(struct work_struct *work);
 void wfx_scan_complete_cb(struct wfx_vif *wvif,
                          const struct hif_ind_scan_cmpl *arg);
-void wfx_scan_failed_cb(struct wfx_vif *wvif);
 
 #endif /* WFX_SCAN_H */