Bladeren bron

iio: mxs-lradc: remove useless check

Checking the channel number is useless since mxs_lradc_read_raw() is called from
a controlled environment and the driver is responsible for filing the struct
iio_chan_spec.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Marek Vasut <marex@denx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Alexandre Belloni 11 jaren geleden
bovenliggende
commit
c842f24195
1 gewijzigde bestanden met toevoegingen van 0 en 4 verwijderingen
  1. 0 4
      drivers/staging/iio/adc/mxs-lradc.c

+ 0 - 4
drivers/staging/iio/adc/mxs-lradc.c

@@ -897,10 +897,6 @@ static int mxs_lradc_read_raw(struct iio_dev *iio_dev,
 {
 	struct mxs_lradc *lradc = iio_priv(iio_dev);
 
-	/* Check for invalid channel */
-	if (chan->channel > LRADC_MAX_TOTAL_CHANS)
-		return -EINVAL;
-
 	switch (m) {
 	case IIO_CHAN_INFO_RAW:
 		if (chan->type == IIO_TEMP)