staging: comedi: hwdrv_apci3120: remove need for boardinfo access
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 14 Oct 2014 17:44:37 +0000 (10:44 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2014 07:48:55 +0000 (15:48 +0800)
The apci3120_ai_insn_config() function is broken in this driver. It does
not follow the comedi API and will fail to work correctly.

For now just remove the need for the boardinfo access to allow additional
cleanup. The 'i_NbrAiChannel' is actually the subdevice 'n_chan' use that
instead and remove the boardinfo access.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c

index d76435668d9a01f6058cb8a016c8680f8d818821..e120d620b3ced1d2223935e77f26629981d2bd93 100644 (file)
@@ -246,7 +246,6 @@ static int apci3120_ai_insn_config(struct comedi_device *dev,
                                   struct comedi_insn *insn,
                                   unsigned int *data)
 {
-       const struct addi_board *this_board = dev->board_ptr;
        struct addi_private *devpriv = dev->private;
        unsigned int i;
 
@@ -261,8 +260,7 @@ static int apci3120_ai_insn_config(struct comedi_device *dev,
                /* Test the number of the channel */
                for (i = 0; i < data[3]; i++) {
 
-                       if (CR_CHAN(data[4 + i]) >=
-                               this_board->i_NbrAiChannel) {
+                       if (CR_CHAN(data[4 + i]) >= s->n_chan) {
                                dev_err(dev->class_dev, "bad channel list\n");
                                return -2;
                        }
This page took 0.026196 seconds and 5 git commands to generate.