lkml.org 
[lkml]   [2018]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.19 108/118] gnss: sirf: fix activation retry handling
    Date
    4.19-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Johan Hovold <johan@kernel.org>

    commit 06fd9ab12b804451b14d538adbf98a57c2d6846b upstream.

    Fix activation helper which would return -ETIMEDOUT even if the last
    retry attempt was successful.

    Also change the semantics of the retries variable so that it actually
    holds the number of retries (rather than tries).

    Fixes: d2efbbd18b1e ("gnss: add driver for sirfstar-based receivers")
    Cc: stable <stable@vger.kernel.org> # 4.19
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/gnss/sirf.c | 6 +++---
    1 file changed, 3 insertions(+), 3 deletions(-)

    --- a/drivers/gnss/sirf.c
    +++ b/drivers/gnss/sirf.c
    @@ -168,7 +168,7 @@ static int sirf_set_active(struct sirf_d
    else
    timeout = SIRF_HIBERNATE_TIMEOUT;

    - while (retries-- > 0) {
    + do {
    sirf_pulse_on_off(data);
    ret = sirf_wait_for_power_state(data, active, timeout);
    if (ret < 0) {
    @@ -179,9 +179,9 @@ static int sirf_set_active(struct sirf_d
    }

    break;
    - }
    + } while (retries--);

    - if (retries == 0)
    + if (retries < 0)
    return -ETIMEDOUT;

    return 0;

    \
     
     \ /
      Last update: 2018-12-11 17:00    [W:7.638 / U:0.564 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site