mirror of https://gitee.com/openkylin/linux.git
staging: comedi: amplc_dio200_common: remove 'continuous' from subdevice private data
This member of the subdevice private data can be determined from the cmd->stop_src. Do that instead. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
cae5c9fb97
commit
22a270483d
|
@ -130,7 +130,6 @@ struct dio200_subdev_intr {
|
||||||
unsigned int enabled_isns;
|
unsigned int enabled_isns;
|
||||||
unsigned int stopcount;
|
unsigned int stopcount;
|
||||||
bool active:1;
|
bool active:1;
|
||||||
bool continuous:1;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline const struct dio200_layout *
|
static inline const struct dio200_layout *
|
||||||
|
@ -259,7 +258,7 @@ static int dio200_start_intr(struct comedi_device *dev,
|
||||||
struct comedi_cmd *cmd = &s->async->cmd;
|
struct comedi_cmd *cmd = &s->async->cmd;
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
|
|
||||||
if (!subpriv->continuous && subpriv->stopcount == 0) {
|
if (cmd->stop_src == TRIG_COUNT && subpriv->stopcount == 0) {
|
||||||
/* An empty acquisition! */
|
/* An empty acquisition! */
|
||||||
s->async->events |= COMEDI_CB_EOA;
|
s->async->events |= COMEDI_CB_EOA;
|
||||||
subpriv->active = false;
|
subpriv->active = false;
|
||||||
|
@ -311,6 +310,7 @@ static void dio200_read_scan_intr(struct comedi_device *dev,
|
||||||
unsigned int triggered)
|
unsigned int triggered)
|
||||||
{
|
{
|
||||||
struct dio200_subdev_intr *subpriv = s->private;
|
struct dio200_subdev_intr *subpriv = s->private;
|
||||||
|
struct comedi_cmd *cmd = &s->async->cmd;
|
||||||
unsigned short val;
|
unsigned short val;
|
||||||
unsigned int n, ch, len;
|
unsigned int n, ch, len;
|
||||||
|
|
||||||
|
@ -332,8 +332,7 @@ static void dio200_read_scan_intr(struct comedi_device *dev,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check for end of acquisition. */
|
/* Check for end of acquisition. */
|
||||||
if (!subpriv->continuous) {
|
if (cmd->stop_src == TRIG_COUNT) {
|
||||||
/* stop_src == TRIG_COUNT */
|
|
||||||
if (subpriv->stopcount > 0) {
|
if (subpriv->stopcount > 0) {
|
||||||
subpriv->stopcount--;
|
subpriv->stopcount--;
|
||||||
if (subpriv->stopcount == 0) {
|
if (subpriv->stopcount == 0) {
|
||||||
|
@ -512,17 +511,10 @@ static int dio200_subdev_intr_cmd(struct comedi_device *dev,
|
||||||
subpriv->active = true;
|
subpriv->active = true;
|
||||||
|
|
||||||
/* Set up end of acquisition. */
|
/* Set up end of acquisition. */
|
||||||
switch (cmd->stop_src) {
|
if (cmd->stop_src == TRIG_COUNT)
|
||||||
case TRIG_COUNT:
|
|
||||||
subpriv->continuous = false;
|
|
||||||
subpriv->stopcount = cmd->stop_arg;
|
subpriv->stopcount = cmd->stop_arg;
|
||||||
break;
|
else /* TRIG_NONE */
|
||||||
default:
|
|
||||||
/* TRIG_NONE */
|
|
||||||
subpriv->continuous = true;
|
|
||||||
subpriv->stopcount = 0;
|
subpriv->stopcount = 0;
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cmd->start_src == TRIG_INT)
|
if (cmd->start_src == TRIG_INT)
|
||||||
s->async->inttrig = dio200_inttrig_start_intr;
|
s->async->inttrig = dio200_inttrig_start_intr;
|
||||||
|
|
Loading…
Reference in New Issue