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

Skip to content
Commit 6c39eed0 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman
Browse files

staging: comedi: comedi_fc: introduce cfc_check_trigger_is_unique



"Step 2" of each do_cmdtest checks that the trigger sources are
unique by doing something like this for each trigger:

	if (cmd->start_src != TRIG_TIMER &&
	    cmd->start_src != TRIG_FOLLOW &&
	    cmd->start_src != TRIG_EXT)
		err++;
	/* Test the remaining triggers similarly */

	if (err)
		return 2;

Introduce a helper function in comedi_fc to handle this boilerplate.
The drivers can then just do:

	err |= cfc_check_trigger_is_unique(cmd->start_src);
	/* Test the remaining triggers similarly */

	if (err)
		return 2;

Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6be4173b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment