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

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

staging: comedi: adl_pci9118: fix the ai cmd->start_arg validation and use



This driver supports three cmd->start_src values, TRIG_NOW, TRIG_EXT, and
TRIG_INT. TRIG_NOW sources should always have an arg of 0 and arg for TRIG_EXT
sources is driver specific. This driver does not use the cmd->start_arg with
the TRIG_EXT source so a trivial value of 0 is good.

When the cmd->start_src is TRIG_INT the cmd->start_arg is actually the valid
trig_num that is passed to the async (*inttrig) callback. This driver allows
any value to be used and currently carries that value in the private data.

Refactor the (*do_cmdtest) so that the trivial validation of the cmd->start_arg
is clear.

Refactor the (*inttrig) so that the cmd->start_arg is used directly to check
the trig_num and remove the then unused 'ai_inttrig_start' member from the
private data.

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 9b799edc
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