Skip to contentSkip to conversation

patch "gnss: sirf: fix activation retry handling" added to char-misc-linus

PATCH [email protected] 1 participant 1 message Dec 7, 2018

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

gnss: sirf: fix activation retry handling

to my char-misc git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
in the char-misc-linus branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.

If you have any questions about this process, please let me know.

Quoted 1 line

From 06fd9ab12b804451b14d538adbf98a57c2d6846b Mon Sep 17 00:00:00 2001

From: Johan Hovold <[email protected]>
Date: Wed, 5 Dec 2018 11:21:49 +0100
Subject: gnss: sirf: fix activation retry handling

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 <[email protected]> # 4.19
---
 drivers/gnss/sirf.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gnss/sirf.c +3 -3
index 71d014edd167..2c22836d3ffd 100644
@@ -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;
Signature · 1 line
2.19.2