Commit 740b48be authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: ni_daq_700: fix return for insn_config function

The comedi insn_config functions should return < 0 for errors or
the number of data elements used to perform the command, this value
is available as 'insn->n'. Return that instead of the open coded
number to better indicate what the return means.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c11a1ea7
...@@ -89,13 +89,12 @@ static int subdev_700_insn_config(struct comedi_device *dev, ...@@ -89,13 +89,12 @@ static int subdev_700_insn_config(struct comedi_device *dev,
break; break;
case INSN_CONFIG_DIO_QUERY: case INSN_CONFIG_DIO_QUERY:
data[1] = (s->io_bits & chan) ? COMEDI_OUTPUT : COMEDI_INPUT; data[1] = (s->io_bits & chan) ? COMEDI_OUTPUT : COMEDI_INPUT;
return insn->n;
break; break;
default: default:
return -EINVAL; return -EINVAL;
} }
return 1; return insn->n;
} }
static int dio700_attach(struct comedi_device *dev, struct comedi_devconfig *it) static int dio700_attach(struct comedi_device *dev, struct comedi_devconfig *it)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment