Commit 154cca64 authored by Jérôme Pouiller's avatar Jérôme Pouiller Committed by Greg Kroah-Hartman

staging: wfx: hif_scan() never fails

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: default avatarJérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191217161318.31402-45-Jerome.Pouiller@silabs.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 871341db
...@@ -36,7 +36,6 @@ static void wfx_scan_restart_delayed(struct wfx_vif *wvif) ...@@ -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) static int wfx_scan_start(struct wfx_vif *wvif, struct wfx_scan_params *scan)
{ {
int ret;
int tmo = 500; int tmo = 500;
if (wvif->state == WFX_STATE_PRE_STA) 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) ...@@ -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); atomic_set(&wvif->wdev->scan_in_progress, 1);
schedule_delayed_work(&wvif->scan.timeout, msecs_to_jiffies(tmo)); schedule_delayed_work(&wvif->scan.timeout, msecs_to_jiffies(tmo));
ret = hif_scan(wvif, scan); hif_scan(wvif, scan);
if (ret) { return 0;
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;
} }
int wfx_hw_scan(struct ieee80211_hw *hw, int wfx_hw_scan(struct ieee80211_hw *hw,
...@@ -245,14 +237,6 @@ static void wfx_scan_complete(struct wfx_vif *wvif) ...@@ -245,14 +237,6 @@ static void wfx_scan_complete(struct wfx_vif *wvif)
wfx_scan_work(&wvif->scan.work); 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, void wfx_scan_complete_cb(struct wfx_vif *wvif,
const struct hif_ind_scan_cmpl *arg) const struct hif_ind_scan_cmpl *arg)
{ {
......
...@@ -38,6 +38,5 @@ void wfx_scan_work(struct work_struct *work); ...@@ -38,6 +38,5 @@ void wfx_scan_work(struct work_struct *work);
void wfx_scan_timeout(struct work_struct *work); void wfx_scan_timeout(struct work_struct *work);
void wfx_scan_complete_cb(struct wfx_vif *wvif, void wfx_scan_complete_cb(struct wfx_vif *wvif,
const struct hif_ind_scan_cmpl *arg); const struct hif_ind_scan_cmpl *arg);
void wfx_scan_failed_cb(struct wfx_vif *wvif);
#endif /* WFX_SCAN_H */ #endif /* WFX_SCAN_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment