staging: comedi: me4000: remove 'chan' check in me4000_ai_insn_read()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 5 Aug 2015 17:44:41 +0000 (10:44 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Aug 2015 22:03:27 +0000 (15:03 -0700)
The comedi core validates that the 'chan' is valid for the subdevice
before calling the (*insn_read) operation. Remove the unnecessary check.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/me4000.c

index 171749b06ef2bd7c4e95489a020d714f2ac241c9..d6b7adc19056fd552928b7c91da5b15e6e9971e8 100644 (file)
@@ -477,11 +477,6 @@ static int me4000_ai_insn_read(struct comedi_device *dev,
        switch (aref) {
        case AREF_GROUND:
        case AREF_COMMON:
-               if (chan >= board->ai_nchan) {
-                       dev_err(dev->class_dev,
-                               "Analog input is not available\n");
-                       return -EINVAL;
-               }
                entry |= ME4000_AI_LIST_INPUT_SINGLE_ENDED | chan;
                break;