From: H Hartley Sweeten Date: Wed, 5 Aug 2015 17:44:41 +0000 (-0700) Subject: staging: comedi: me4000: remove 'chan' check in me4000_ai_insn_read() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=03611e5491e488f30a5b7653e02ee65032cfba14;p=linux-beck.git staging: comedi: me4000: remove 'chan' check in me4000_ai_insn_read() 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 Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/me4000.c b/drivers/staging/comedi/drivers/me4000.c index 171749b06ef2..d6b7adc19056 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;