From: H Hartley Sweeten Date: Wed, 28 May 2014 23:26:51 +0000 (-0700) Subject: staging: comedi: ni_mio_common: use dev->write_subdev X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e879c315c3050a1b422291e5a7509dc24ec2c7d1;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c index 7083af267e2d..0bffc56b73cc 100644 --- a/drivers/staging/comedi/drivers/ni_mio_common.c +++ b/drivers/staging/comedi/drivers/ni_mio_common.c @@ -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;