]> git.baikalelectronics.ru Git - kernel.git/commit
staging: comedi: adv_pci1710: only calc the pacer divisors once
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 29 Apr 2014 18:08:37 +0000 (11:08 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 4 May 2014 00:02:42 +0000 (20:02 -0400)
commitcb2c1752a1864f8104ede9d44f5631948551c5db
tree53749174129971cd02e72a75bfc720ed76faaafc
parent4f8dacbaea1c0e767ddfa261593b209ded09077c
staging: comedi: adv_pci1710: only calc the pacer divisors once

When the cmd->convert_src == TRIG_TIMER the divisors needed to
generate the pacer time are calculated in the (*do_cmdtest) to
validate the cmd->convert_arg. The core always does the (*do_cmdtest)
before the (*do_cmd) so there is no reason to recalc the divisors.

Save the calculated divisors in the private data as 'next_divisor[12]'.
The (*do_cmd) then transfers them to the private data 'divisor[12]' so
that they can be used to set the timer for the command immediately or
later when the cmd->start_src is TRIG_EXT (mode 2 in this driver).

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>
drivers/staging/comedi/drivers/adv_pci1710.c