summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/drivers/das16.c
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2014-07-18 17:01:16 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-07-21 14:43:01 -0700
commita207c12f62e8b53e1e1600ca384b13a39a9feed2 (patch)
treeed32cfa28deb3711f6b3e2b86319cdeffacb8ab9 /drivers/staging/comedi/drivers/das16.c
parent79014eb1f25e145ea0dc70c628d1ad24106afba3 (diff)
staging: comedi: drivers: cleanup cmd->flags use
Most of the comedi drivers that support async commands have some sort of timer to control the acquisition timing. For these drivers, Step 4 of the (*do_cmdtest) operations calls a ns_to_timer() function that converts the desired ns time of the command into a value used to set the timer. These ns_to_timer() functions also typically pass the cmd->flags in order to determine the desired rounding mode. Some of the drivers mask the cmd->flags with TRIG_ROUND_MASK when calling the ns_to_timer() functions. Move all the masking into the ns_to_timer() functions and just pass the cmd->flags directly. The cmd->flags member is an unsigned int, change the parameter type in the the ns_to_timer() functions to match. For aesthetics, rename the parameter in all the ns_to_timer() functions to 'flags'. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/drivers/das16.c')
-rw-r--r--drivers/staging/comedi/drivers/das16.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/staging/comedi/drivers/das16.c b/drivers/staging/comedi/drivers/das16.c
index d92cc181112d..057bc16f8ddc 100644
--- a/drivers/staging/comedi/drivers/das16.c
+++ b/drivers/staging/comedi/drivers/das16.c
@@ -729,14 +729,14 @@ static int das16_cmd_test(struct comedi_device *dev, struct comedi_subdevice *s,
}
static unsigned int das16_set_pacer(struct comedi_device *dev, unsigned int ns,
- int rounding_flags)
+ unsigned int flags)
{
struct das16_private_struct *devpriv = dev->private;
unsigned long timer_base = dev->iobase + DAS16_TIMER_BASE_REG;
i8253_cascade_ns_to_timer(devpriv->clockbase,
&devpriv->divisor1, &devpriv->divisor2,
- &ns, rounding_flags);
+ &ns, flags);
i8254_set_mode(timer_base, 0, 1, I8254_MODE2 | I8254_BINARY);
i8254_set_mode(timer_base, 0, 2, I8254_MODE2 | I8254_BINARY);
@@ -782,9 +782,7 @@ static int das16_cmd_exec(struct comedi_device *dev, struct comedi_subdevice *s)
}
/* set counter mode and counts */
- cmd->convert_arg =
- das16_set_pacer(dev, cmd->convert_arg,
- cmd->flags & TRIG_ROUND_MASK);
+ cmd->convert_arg = das16_set_pacer(dev, cmd->convert_arg, cmd->flags);
/* enable counters */
byte = 0;