From: H Hartley Sweeten Date: Mon, 10 Feb 2014 18:49:38 +0000 (-0700) Subject: staging: comedi: dt282x: use comedi_timeout() X-Git-Tag: v3.15-rc1~139^2~1069 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d8644e418b2613b3eaf1e10fe6fd0d84018c2f8a;p=pandora-kernel.git 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: H Hartley Sweeten Cc: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed