From: H Hartley Sweeten Date: Fri, 20 Jun 2014 20:12:59 +0000 (-0700) Subject: staging: comedi: dt282x: avoid calculating the timer divisor multiple times X-Git-Tag: omap-for-v3.17/fixes-against-rc2~166^2~1526 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ec2e20274f5721949c27eac403e876f397db50e;p=pandora-kernel.git staging: comedi: dt282x: avoid calculating the timer divisor multiple times A common timer is used for analog input and output async commands. The (*do_cmdtest) for both subdevices calculates the divisor as part of Step 4 when validating the trigger arguments. The divisor is calculated again in the (*do_cmd) for both subdevices in order to set the timer. The comedi core only calls the (*do_cmd) is called after a successful (*do_cmdtest). Save the divisor from the (*do_cmdtest) in the private data and use that value in the (*do_cmd). The extra check of the cmd->convert_arg in dt282x_ai_cmd() is not necessary. The convert_arg was already checked in the (*do_cmdtest), and it's not used in the (*do_cmd). Tidy up dt282x_ns_to_timer(), the parameters are all unsigned int's and the mask of the 'flags' can be moved here to simplify the callers. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed