staging: comedi: pcl816: don't calc the timer divisors twice
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 19 Feb 2014 17:11:23 +0000 (10:11 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Feb 2014 20:39:38 +0000 (12:39 -0800)
commitf23068ec57acd6fb0bf4c69075072350a5ff849a
tree14c1a8ada6d2dd1c9d244fdcf770e884821c635c
parente5f376df8b13cf09220a8003469b10a9b8095d3c
staging: comedi: pcl816: 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 pcl816_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/pcl816.c