summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/drivers/ni_tiocmd.c
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2016-04-20 10:36:37 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-04-28 22:18:51 -0700
commit4d88096df9ca49b71381eda90aa770c6db237f54 (patch)
treeec62c2f98dfd0c7db6426030a2a7947989e1786f /drivers/staging/comedi/drivers/ni_tiocmd.c
parent96f31530006492b2c753311431acf71df88b0cdd (diff)
staging: comedi: mite: introduce mite_ack_linkc()
Introduce a helper function to handle the ack of a LINKC interrupt. Tidy up the drivers that use the new helper. The extra check for CHSR_INT in the ni_pcidio driver is not necessary. This bit will be set if any of the interrupt sources, including CHSR_LINKC, have generated an interrupt. Remove the extra check. The mite_get_status() function is now only used by the mite driver. Make it static and remove the export. 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/ni_tiocmd.c')
-rw-r--r--drivers/staging/comedi/drivers/ni_tiocmd.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/staging/comedi/drivers/ni_tiocmd.c b/drivers/staging/comedi/drivers/ni_tiocmd.c
index 3c3f5430e552..dc0b0f3d9db1 100644
--- a/drivers/staging/comedi/drivers/ni_tiocmd.c
+++ b/drivers/staging/comedi/drivers/ni_tiocmd.c
@@ -400,7 +400,6 @@ void ni_tio_handle_interrupt(struct ni_gpct *counter,
struct comedi_subdevice *s)
{
unsigned int cidx = counter->counter_index;
- unsigned int gpct_mite_status;
unsigned long flags;
int gate_error;
int tc_error;
@@ -429,16 +428,10 @@ void ni_tio_handle_interrupt(struct ni_gpct *counter,
break;
}
spin_lock_irqsave(&counter->lock, flags);
- if (!counter->mite_chan) {
- spin_unlock_irqrestore(&counter->lock, flags);
- return;
+ if (counter->mite_chan) {
+ mite_ack_linkc(counter->mite_chan);
+ mite_sync_input_dma(counter->mite_chan, s);
}
- gpct_mite_status = mite_get_status(counter->mite_chan);
- if (gpct_mite_status & CHSR_LINKC)
- writel(CHOR_CLRLC,
- counter->mite_chan->mite->mite_io_addr +
- MITE_CHOR(counter->mite_chan->channel));
- mite_sync_input_dma(counter->mite_chan, s);
spin_unlock_irqrestore(&counter->lock, flags);
}
EXPORT_SYMBOL_GPL(ni_tio_handle_interrupt);