staging: comedi: serial2002: Set range for digital inputs and outputs
authorIan Abbott <abbotti@mev.co.uk>
Fri, 24 Aug 2012 16:26:26 +0000 (17:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 4 Sep 2012 18:52:55 +0000 (11:52 -0700)
I got an update from the original author of this driver (Anders
Blomdell) to set the range table for digital input and digital output
subdevices.  Apply it.

Cc: Anders Blomdell <anders.blomdell@control.lth.se>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/serial2002.c

index c18314be8c826c37a1f6a8e1353f38b8b7afff45..0b58eec97f784a7e1d2f8113b19325a0ba868844 100644 (file)
@@ -588,7 +588,9 @@ static int serial_2002_open(struct comedi_device *dev)
                                kfree(s->range_table_list);
                                s->range_table = NULL;
                                s->range_table_list = NULL;
-                               if (range) {
+                               if (kind == 1 || kind == 2) {
+                                       s->range_table = &range_digital;
+                               } else if (range) {
                                        s->range_table_list = range_table_list =
                                            kmalloc(sizeof
                                                    (struct