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

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

staging: comedi: dt282x: use comedi_timeout()



The wait_for() macro in this driver is a bit nasty. It effects control flow
which according to the CodingStyle is a _very_ bad idea.

The mux_busy() and ad_done() macros are also bad since they rely on a local
variable having a specific name.

Remove these macros and use comedi_timeout() to wait for the analog input
mux busy completion and end-of-conversion. Both of these are detected by
reading the same register and testing different bits. Pass the bits to test
as the 'context' to the callback function.

The dt282x_ai_cmd() function also checks for the mux busy completion. The
'insn' is not available here but passing NULL is safe because nothing
uses it.

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 45b281e4
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