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 <hswee...@visionengravers.com>
Cc: Ian Abbott <abbo...@mev.co.uk>
Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
---
 drivers/staging/comedi/drivers/me4000.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/staging/comedi/drivers/me4000.c 
b/drivers/staging/comedi/drivers/me4000.c
index 171749b..d6b7adc 100644
--- a/drivers/staging/comedi/drivers/me4000.c
+++ b/drivers/staging/comedi/drivers/me4000.c
@@ -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;
 
-- 
2.4.3

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to