diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2016-04-21 19:04:38 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-04-29 05:19:49 (GMT) |
commit | 72639a16704b10cf5fffaa52715929dc8f081528 (patch) | |
tree | 3c6fd58f89bea9807c28a10e53a9f38f8891db78 /drivers/staging | |
parent | cc38da7287ed4f0f08956351167c31e4e6abc427 (diff) | |
download | linux-72639a16704b10cf5fffaa52715929dc8f081528.tar.xz |
staging: comedi: ni_mio_common: absorb mite_handle_b_linkc()
Simplfy the LINKC handing by removing the helper function and moving
the mite_sync_dma() into the main interrupt handler.
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')
-rw-r--r-- | drivers/staging/comedi/drivers/ni_mio_common.c | 31 |
1 files changed, 7 insertions, 24 deletions
diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c index 2e27815..b2657de 100644 --- a/drivers/staging/comedi/drivers/ni_mio_common.c +++ b/drivers/staging/comedi/drivers/ni_mio_common.c @@ -927,19 +927,6 @@ static int ni_ai_drain_dma(struct comedi_device *dev) return retval; } -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->write_subdev; - unsigned long flags; - - spin_lock_irqsave(&devpriv->mite_channel_lock, flags); - if (devpriv->ao_mite_chan) - mite_sync_dma(devpriv->ao_mite_chan, s); - spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags); -} - static int ni_ao_wait_for_dma_load(struct comedi_device *dev) { static const int timeout = 10000; @@ -1403,16 +1390,6 @@ static void handle_b_interrupt(struct comedi_device *dev, unsigned int ao_mite_status) { struct comedi_subdevice *s = dev->write_subdev; - /* unsigned short ack=0; */ - -#ifdef PCIDMA - /* Currently, mite.c requires us to handle LINKC */ - if (ao_mite_status & CHSR_LINKC) { - struct ni_private *devpriv = dev->private; - - mite_handle_b_linkc(devpriv->mite, dev); - } -#endif if (b_status == 0xffff) return; @@ -5200,9 +5177,15 @@ static irqreturn_t ni_E_interrupt(int irq, void *d) if (devpriv->ai_mite_chan) ai_mite_status = mite_ack_linkc(devpriv->ai_mite_chan, dev->read_subdev); - if (devpriv->ao_mite_chan) + + if (devpriv->ao_mite_chan) { ao_mite_status = mite_ack_linkc(devpriv->ao_mite_chan, dev->write_subdev); + if (ao_mite_status & CHSR_LINKC) + mite_sync_dma(devpriv->ao_mite_chan, + dev->write_subdev); + } + spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags_too); } #endif |