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

Commit 40859329 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "iio: qcom-rradc: Disable continuous mode when read fails"

parents 53d383a9 99916235
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -793,7 +793,7 @@ static int rradc_check_status_ready_with_retry(struct rradc_chip *chip,
static int rradc_read_channel_with_continuous_mode(struct rradc_chip *chip,
			struct rradc_chan_prop *prop, u8 *buf)
{
	int rc = 0;
	int rc = 0, ret = 0;
	u16 status = 0;

	rc = rradc_enable_continuous_mode(chip);
@@ -806,23 +806,25 @@ static int rradc_read_channel_with_continuous_mode(struct rradc_chip *chip,
	rc = rradc_read(chip, status, buf, 1);
	if (rc < 0) {
		pr_err("status read failed:%d\n", rc);
		return rc;
		ret = rc;
		goto disable;
	}

	rc = rradc_check_status_ready_with_retry(chip, prop,
						buf, status);
	if (rc < 0) {
		pr_err("Status read failed:%d\n", rc);
		return rc;
		ret = rc;
	}

disable:
	rc = rradc_disable_continuous_mode(chip);
	if (rc < 0) {
		pr_err("Failed to switch to non continuous mode\n");
		return rc;
		ret = rc;
	}

	return rc;
	return ret;
}

static int rradc_enable_batt_id_channel(struct rradc_chip *chip, bool enable)