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

Commit 1ecdb863 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "iio: adc: Update error handling for ADC reading"

parents 4c5fed65 8e15ce5f
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -547,14 +547,19 @@ static int adc_do_conversion(struct adc_chip *adc,
	if (ret < 0)
		goto unlock;

	if ((chan->type == IIO_VOLTAGE) || (chan->type == IIO_TEMP))
	if ((chan->type == IIO_VOLTAGE) || (chan->type == IIO_TEMP)) {
		ret = adc_read_voltage_data(adc, data_volt);
		if (ret)
			goto unlock;
	}
	else if (chan->type == IIO_POWER) {
		ret = adc_read_voltage_data(adc, data_volt);
		if (ret)
			goto unlock;

		ret = adc_read_current_data(adc, data_cur);
		if (ret)
			goto unlock;
	}

	ret = adc_post_configure_usb_in_read(adc, prop);