diff options
author | Jérôme Pouiller <[email protected]> | 2020-01-15 13:54:05 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2020-01-16 20:59:45 +0100 |
commit | 99aa34a62bce1366aa0b856ba9262e19072a1faf (patch) | |
tree | 749906c239fcdc7a5fb1f90503dcda60ef91faaf | |
parent | 8b08b6a8c31f18c3657405410e4c3f6bc4fa75f1 (diff) |
staging: wfx: make hif_scan() usage clearer
hif_scan() return max number of jiffies to wait before the completion
indication. However, if this value is negative, an error has occurred.
Reword the code to reflect that behavior.
Signed-off-by: Jérôme Pouiller <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r-- | drivers/staging/wfx/scan.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index 24061d09c404..9b3674b3226a 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -56,10 +56,9 @@ static int send_scan_req(struct wfx_vif *wvif, wfx_tx_lock_flush(wvif->wdev); wvif->scan_abort = false; reinit_completion(&wvif->scan_complete); - ret = hif_scan(wvif, req, start_idx, i - start_idx); - if (ret < 0) - return ret; - timeout = ret; + timeout = hif_scan(wvif, req, start_idx, i - start_idx); + if (timeout < 0) + return timeout; ret = wait_for_completion_timeout(&wvif->scan_complete, timeout); if (req->channels[start_idx]->max_power != wvif->wdev->output_power) hif_set_output_power(wvif, wvif->wdev->output_power * 10); |