Commit e879c315 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: ni_mio_common: use dev->write_subdev

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: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5dce16e5
...@@ -732,7 +732,7 @@ static void mite_handle_b_linkc(struct mite_struct *mite, ...@@ -732,7 +732,7 @@ static void mite_handle_b_linkc(struct mite_struct *mite,
struct comedi_device *dev) struct comedi_device *dev)
{ {
struct ni_private *devpriv = dev->private; 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; unsigned long flags;
spin_lock_irqsave(&devpriv->mite_channel_lock, flags); spin_lock_irqsave(&devpriv->mite_channel_lock, flags);
...@@ -1238,7 +1238,7 @@ static void handle_b_interrupt(struct comedi_device *dev, ...@@ -1238,7 +1238,7 @@ static void handle_b_interrupt(struct comedi_device *dev,
unsigned short b_status, unsigned ao_mite_status) unsigned short b_status, unsigned ao_mite_status)
{ {
struct ni_private *devpriv = dev->private; 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; */ /* unsigned short ack=0; */
#ifdef PCIDMA #ifdef PCIDMA
...@@ -1361,7 +1361,7 @@ static int ni_ao_setup_MITE_dma(struct comedi_device *dev) ...@@ -1361,7 +1361,7 @@ static int ni_ao_setup_MITE_dma(struct comedi_device *dev)
{ {
const struct ni_board_struct *board = comedi_board(dev); const struct ni_board_struct *board = comedi_board(dev);
struct ni_private *devpriv = dev->private; struct ni_private *devpriv = dev->private;
struct comedi_subdevice *s = &dev->subdevices[NI_AO_SUBDEV]; struct comedi_subdevice *s = dev->write_subdev;
int retval; int retval;
unsigned long flags; unsigned long flags;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment