staging: comedi: pcl818: don't calc the timer divisors twice
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 17 Feb 2014 21:27:39 +0000 (14:27 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 18 Feb 2014 19:55:32 +0000 (11:55 -0800)
commitf4985a79ca5ba6a2eb0edeb3125a7e763c3e6cc2
treeafc91292f62cefa2daed9c750ba96c1424887c71
parentf8d863e4a9b7c7fefa9a1e743d5c290175e361bc
staging: comedi: pcl818: don't calc the timer divisors twice

The timer divisors are calculated in the (*do_cmdtest) before the (*do_cmd)
is called by the comedi core. The extra sanity checks in the (*do_cmd) are
not necessary, the values returned from i8253_cascade_ns_to_timer() will be
greater than 1. Save the values in the private data so they don't need to be
recalced.

Refactor pcl818_start_pacer() to use the values from the private data.

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/pcl818.c