Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 27cb9814 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman
Browse files

staging: comedi: s626: clarify COMEDI_CB_EOA code



The end-of-acquisition only applies when the cmd->stop_src == TRIG_COUNT.

Refactor the code in s626_handle_eos_interrupt() that detects the end-of-
acquisition to clarify this.

Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e37b20aa
Loading
Loading
Loading
Loading
+10 −9
Original line number Diff line number Diff line
@@ -1501,7 +1501,7 @@ static bool s626_handle_eos_interrupt(struct comedi_device *dev)
	/* end of scan occurs */
	async->events |= COMEDI_CB_EOS;

	if (cmd->stop_src == TRIG_COUNT)
	if (cmd->stop_src == TRIG_COUNT) {
		devpriv->ai_sample_count--;
		if (devpriv->ai_sample_count <= 0) {
			devpriv->ai_cmd_running = 0;
@@ -1515,6 +1515,7 @@ static bool s626_handle_eos_interrupt(struct comedi_device *dev)
			/* disable master interrupt */
			finished = true;
		}
	}

	if (devpriv->ai_cmd_running && cmd->scan_begin_src == TRIG_EXT)
		s626_dio_set_irq(dev, cmd->scan_begin_arg);