Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 06fd9ab1 authored by Johan Hovold's avatar Johan Hovold
Browse files

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: d2efbbd1 ("gnss: add driver for sirfstar-based receivers")
Cc: stable <stable@vger.kernel.org>	# 4.19
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
parent 25956467
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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;