staging: comedi: ni_mio_common: use dev->write_subdev
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 28 May 2014 23:26:51 +0000 (16:26 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jun 2014 21:33:52 +0000 (14:33 -0700)
The (*attach) in ni_E_init() sets the dev->write_subdev to the analog
output subdevice. Use that instead of accessing the dev->subdevices
array directly.

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/ni_mio_common.c

index 7083af2..0bffc56 100644 (file)
@@ -732,7 +732,7 @@ static void mite_handle_b_linkc(struct mite_struct *mite,
                                struct comedi_device *dev)
 {
        struct ni_private *devpriv = dev->private;
-       struct comedi_subdevice *s = &dev->subdevices[NI_AO_SUBDEV];
+       struct comedi_subdevice *s = dev->write_subdev;
        unsigned long flags;
 
        spin_lock_irqsave(&devpriv->mite_channel_lock, flags);
@@ -1238,7 +1238,7 @@ static void handle_b_interrupt(struct comedi_device *dev,
                               unsigned short b_status, unsigned ao_mite_status)
 {
        struct ni_private *devpriv = dev->private;
-       struct comedi_subdevice *s = &dev->subdevices[NI_AO_SUBDEV];
+       struct comedi_subdevice *s = dev->write_subdev;
        /* unsigned short ack=0; */
 
 #ifdef PCIDMA
@@ -1361,7 +1361,7 @@ static int ni_ao_setup_MITE_dma(struct comedi_device *dev)
 {
        const struct ni_board_struct *board = comedi_board(dev);
        struct ni_private *devpriv = dev->private;
-       struct comedi_subdevice *s = &dev->subdevices[NI_AO_SUBDEV];
+       struct comedi_subdevice *s = dev->write_subdev;
        int retval;
        unsigned long flags;