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

Commit 074b6a8d authored by Zubair Lutfullah's avatar Zubair Lutfullah Committed by Jonathan Cameron
Browse files

iio: ti_am335x_adc: cleanup error case



Driver is functional without this error case. Cleaned up.

Signed-off-by: default avatarZubair Lutfullah <zubair.lutfullah@gmail.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent a77d0209
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -323,7 +323,6 @@ static int tiadc_read_raw(struct iio_dev *indio_dev,
	struct tiadc_device *adc_dev = iio_priv(indio_dev);
	int i, map_val;
	unsigned int fifo1count, read, stepid;
	u32 step = UINT_MAX;
	bool found = false;
	u32 step_en;
	unsigned long timeout = jiffies + usecs_to_jiffies
@@ -353,15 +352,6 @@ static int tiadc_read_raw(struct iio_dev *indio_dev,
	 * Hence we need to flush out this data.
	 */

	for (i = 0; i < ARRAY_SIZE(adc_dev->channel_step); i++) {
		if (chan->channel == adc_dev->channel_line[i]) {
			step = adc_dev->channel_step[i];
			break;
		}
	}
	if (WARN_ON_ONCE(step == UINT_MAX))
		return -EINVAL;

	fifo1count = tiadc_readl(adc_dev, REG_FIFO1CNT);
	for (i = 0; i < fifo1count; i++) {
		read = tiadc_readl(adc_dev, REG_FIFO1);