[PATCH v2 16/17] staging: comedi: core: only update outputs with comedi_dio_update_state()

H Hartley Sweeten hsweeten at visionengravers.com
Fri Aug 30 01:00:51 UTC 2013


Make sure that only the state of the channels configured as outputs are
updated.

Signed-off-by: H Hartley Sweeten <hsweeten at visionengravers.com>
Cc: Ian Abbott <abbotti at mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh at 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 75d877b..777be6d 100644
--- a/drivers/staging/comedi/drivers.c
+++ b/drivers/staging/comedi/drivers.c
@@ -198,7 +198,7 @@ EXPORT_SYMBOL_GPL(comedi_dio_insn_config);
 unsigned int comedi_dio_update_state(struct comedi_subdevice *s,
 				     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



More information about the devel mailing list