staging: comedi: ni_mio_common: absorb mite_handle_b_linkc()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Thu, 21 Apr 2016 19:04:38 +0000 (12:04 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Apr 2016 05:19:49 +0000 (22:19 -0700)
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>
drivers/staging/comedi/drivers/ni_mio_common.c

index 2e27815bd6329c0618cdab653de750ffd5f493ff..b2657de7cca1b6a1409c1a08ea9c2e1800a368a1 100644 (file)
@@ -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