summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/drivers/dt282x.c
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2013-12-05 13:43:32 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-06 13:07:16 -0800
commit95dc140a5e9210c6305b4f8b91cf2e654e1bba1e (patch)
treea385691dec81853fcaa1a4dd0bbc39599661962c /drivers/staging/comedi/drivers/dt282x.c
parent9ee0de0ec1196df99c9d6ecec6a25ee383de6bc1 (diff)
staging: comedi: dt282x: use dev->write_subdev
Use the dev->write_subdev that was setup in the device attach 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>
Diffstat (limited to 'drivers/staging/comedi/drivers/dt282x.c')
-rw-r--r--drivers/staging/comedi/drivers/dt282x.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/staging/comedi/drivers/dt282x.c b/drivers/staging/comedi/drivers/dt282x.c
index 5815fc289299..ae714a526c35 100644
--- a/drivers/staging/comedi/drivers/dt282x.c
+++ b/drivers/staging/comedi/drivers/dt282x.c
@@ -306,10 +306,10 @@ static void dt282x_munge(struct comedi_device *dev, unsigned short *buf,
static void dt282x_ao_dma_interrupt(struct comedi_device *dev)
{
struct dt282x_private *devpriv = dev->private;
+ struct comedi_subdevice *s = dev->write_subdev;
void *ptr;
int size;
int i;
- struct comedi_subdevice *s = &dev->subdevices[1];
outw(devpriv->supcsr | DT2821_CLRDMADNE, dev->iobase + DT2821_SUPCSR);
@@ -449,7 +449,7 @@ static irqreturn_t dt282x_interrupt(int irq, void *d)
struct comedi_device *dev = d;
struct dt282x_private *devpriv = dev->private;
struct comedi_subdevice *s = dev->read_subdev;
- struct comedi_subdevice *s_ao;
+ struct comedi_subdevice *s_ao = dev->write_subdev;
unsigned int supcsr, adcsr, dacsr;
int handled = 0;
@@ -458,7 +458,6 @@ static irqreturn_t dt282x_interrupt(int irq, void *d)
return IRQ_HANDLED;
}
- s_ao = &dev->subdevices[1];
adcsr = inw(dev->iobase + DT2821_ADCSR);
dacsr = inw(dev->iobase + DT2821_DACSR);
supcsr = inw(dev->iobase + DT2821_SUPCSR);