From: H Hartley Sweeten Date: Tue, 11 Sep 2012 17:47:33 +0000 (-0700) Subject: staging: comedi: adl_pci9111: use cfc_check_trigger_src X-Git-Tag: next-20120912~22^2~55 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=97e01bb10a193b1d8592303d8858192ee9ea32f7;p=karo-tx-linux.git staging: comedi: adl_pci9111: use cfc_check_trigger_src Remove the pci9111_check_trigger_src macro and use the helper function cfc_check_trigger_src instead. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/adl_pci9111.c b/drivers/staging/comedi/drivers/adl_pci9111.c index 7cf015e65406..ebd819ef967e 100644 --- a/drivers/staging/comedi/drivers/adl_pci9111.c +++ b/drivers/staging/comedi/drivers/adl_pci9111.c @@ -342,18 +342,9 @@ static int pci9111_ai_cancel(struct comedi_device *dev, return 0; } -/* Test analog input command */ - -#define pci9111_check_trigger_src(src, flags) do { \ - tmp = src; \ - src &= flags; \ - if (!src || tmp != src) \ - error++; \ - } while (false); - -static int -pci9111_ai_do_cmd_test(struct comedi_device *dev, - struct comedi_subdevice *s, struct comedi_cmd *cmd) +static int pci9111_ai_do_cmd_test(struct comedi_device *dev, + struct comedi_subdevice *s, + struct comedi_cmd *cmd) { struct pci9111_private_data *dev_private = dev->private; int tmp; @@ -361,14 +352,16 @@ pci9111_ai_do_cmd_test(struct comedi_device *dev, int range, reference; int i; - /* Step 1 : check if trigger are trivialy valid */ + /* Step 1 : check if trigger are trivialy valid */ - pci9111_check_trigger_src(cmd->start_src, TRIG_NOW); - pci9111_check_trigger_src(cmd->scan_begin_src, - TRIG_TIMER | TRIG_FOLLOW | TRIG_EXT); - pci9111_check_trigger_src(cmd->convert_src, TRIG_TIMER | TRIG_EXT); - pci9111_check_trigger_src(cmd->scan_end_src, TRIG_COUNT); - pci9111_check_trigger_src(cmd->stop_src, TRIG_COUNT | TRIG_NONE); + error |= cfc_check_trigger_src(&cmd->start_src, TRIG_NOW); + error |= cfc_check_trigger_src(&cmd->scan_begin_src, + TRIG_TIMER | TRIG_FOLLOW | TRIG_EXT); + error |= cfc_check_trigger_src(&cmd->convert_src, + TRIG_TIMER | TRIG_EXT); + error |= cfc_check_trigger_src(&cmd->scan_end_src, TRIG_COUNT); + error |= cfc_check_trigger_src(&cmd->stop_src, + TRIG_COUNT | TRIG_NONE); if (error) return 1;