staging: comedi: ni_mio_common: remove ai_continuous from private data
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 14 Jul 2014 19:23:49 +0000 (12:23 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Jul 2014 20:24:42 +0000 (13:24 -0700)
This member of the private data can be determined by checking the
cmd->stop_src. Do that instead and remove the member.

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
drivers/staging/comedi/drivers/ni_stc.h

index 9bcf8351129d9fa9d23f28d1e09697b14636a957..1718382a7e7c2879a6e385d2d8cc5d63829fcf1f 100644 (file)
@@ -1499,8 +1499,8 @@ static void ack_a_interrupt(struct comedi_device *dev, unsigned short a_status)
 static void handle_a_interrupt(struct comedi_device *dev, unsigned short status,
                               unsigned ai_mite_status)
 {
-       struct ni_private *devpriv = dev->private;
        struct comedi_subdevice *s = dev->read_subdev;
+       struct comedi_cmd *cmd = &s->async->cmd;
 
        /* 67xx boards don't have ai subdevice, but their gpct0 might generate an a interrupt */
        if (s->type == COMEDI_SUBD_UNUSED)
@@ -1551,7 +1551,7 @@ static void handle_a_interrupt(struct comedi_device *dev, unsigned short status,
                        return;
                }
                if (status & AI_SC_TC_St) {
-                       if (!devpriv->ai_continuous)
+                       if (cmd->stop_src == TRIG_COUNT)
                                shutdown_ai_command(dev);
                }
        }
@@ -2513,7 +2513,6 @@ static int ni_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
                /* load SC (Scan Count) */
                ni_stc_writew(dev, AI_SC_Load, AI_Command_1_Register);
 
-               devpriv->ai_continuous = 0;
                if (stop_count == 0) {
                        devpriv->ai_cmd2 |= AI_End_On_End_Of_Scan;
                        interrupt_a_enable |= AI_STOP_Interrupt_Enable;
@@ -2532,9 +2531,6 @@ static int ni_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
 
                /* load SC (Scan Count) */
                ni_stc_writew(dev, AI_SC_Load, AI_Command_1_Register);
-
-               devpriv->ai_continuous = 1;
-
                break;
        }
 
index 2b937d37ae9b5db6cf9490c8d12030fbf18af97b..6f9c4811e231f45a496c50a3b8634414b1b904b1 100644 (file)
@@ -1422,7 +1422,6 @@ struct ni_private {
        unsigned short dio_output;
        unsigned short dio_control;
        int aimode;
-       int ai_continuous;
        unsigned int ai_calib_source;
        unsigned int ai_calib_source_enabled;
        spinlock_t window_lock;