]> git.karo-electronics.de Git - karo-tx-linux.git/commit
staging: comedi: pcl711: no need to calc the timer values twice
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 20 Sep 2013 23:44:08 +0000 (16:44 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Sep 2013 23:00:01 +0000 (16:00 -0700)
commit8fbf1f4569634e950c1ebc46b0bad612ea404b00
tree9f0516077a4c3d74b7e6f06ec8787ffd80fe6635
parent326d875da33b2b72e409868681c76d6863fd191b
staging: comedi: pcl711: no need to calc the timer values twice

The comedi core always calls the (*do_cmdtest) function to validate
a command before it calls the (*do_cmd) function.

Since the (*do_cmdtest) has already calculated the timer values in
order to validate the cmd->scan_begin_arg there is no reason to
recalc the values in the (*do_cmd).

This also fixes a bug in the driver. The (*do_cmdtest) was using a
time base value of 100 and but the (*do_cmd) was using a time base
of 500. These result in different timer values. The functions used
to calculate the values are actually the same due to a #define in
the 8253.h header.

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