summaryrefslogtreecommitdiffstats
path: root/drivers/gnss
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gnss')
-rw-r--r--drivers/gnss/sirf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gnss/sirf.c b/drivers/gnss/sirf.c
index b3a4c0e91947..226f6e6fe01b 100644
--- a/drivers/gnss/sirf.c
+++ b/drivers/gnss/sirf.c
@@ -168,7 +168,7 @@ static int sirf_set_active(struct sirf_data *data, bool active)
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_data *data, bool active)
}
break;
- }
+ } while (retries--);
- if (retries == 0)
+ if (retries < 0)
return -ETIMEDOUT;
return 0;