From d8644e418b2613b3eaf1e10fe6fd0d84018c2f8a Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Mon, 10 Feb 2014 11:49:38 -0700 Subject: [PATCH] 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-format-patch failed