]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
staging: wfx: make hif_scan() usage clearer
authorJérôme Pouiller <jerome.pouiller@silabs.com>
Wed, 15 Jan 2020 13:54:05 +0000 (13:54 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 Jan 2020 19:59:45 +0000 (20:59 +0100)
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 <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-3-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wfx/scan.c

index 24061d09c40482f76af1f0bd3c5ea064e6626097..9b3674b3226a34f2ff891e7891e1130b1bf371cc 100644 (file)
@@ -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);