Make sure only the state of the channels configured as outputs is updated
by comedi_dio_insn_bits().

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.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
index 7477514..8d8bf22 100644
--- a/drivers/staging/comedi/drivers.c
+++ b/drivers/staging/comedi/drivers.c
@@ -202,7 +202,7 @@ int comedi_dio_insn_bits(struct comedi_device *dev,
                         struct comedi_insn *insn,
                         unsigned int *data)
 {
-       unsigned int mask = data[0];
+       unsigned int mask = data[0] & s->io_bits;       /* outputs only */
        unsigned int bits = data[1];
 
        if (mask) {
-- 
1.8.3.2

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

Reply via email to