iio: mxs-lradc: remove useless check
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>
Sat, 18 Jan 2014 19:05:00 +0000 (19:05 +0000)
committerJonathan Cameron <jic23@kernel.org>
Mon, 3 Feb 2014 19:07:44 +0000 (19:07 +0000)
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>
drivers/staging/iio/adc/mxs-lradc.c

index df71669bb60ea51be793903d7a62df399e388c55..7b9224198bb8f71759c1f894d3da2dca205be508 100644 (file)
@@ -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)