]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: comedi: adl_pci9111: remove extra i8253_cascade_ns_to_timer_2div()
authorH Hartley Sweeten <hartleys@visionengravers.com>
Tue, 11 Sep 2012 17:48:47 +0000 (10:48 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Sep 2012 19:11:05 +0000 (12:11 -0700)
The comedi core always calls the 'do_cmdtest' function before it
calls the 'do_cmd' function. The 'do_cmdtest' for this driver calls
i8253_cascade_ns_to_timer_2div() to validate the cmd->convert_arg.
This call sets the dev_private 'div1' and 'div2' values needed to
program the 8254 timer. There is no need to call the i8253 function
a second time in the do_cmd function.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/adl_pci9111.c

index 7f7efe1443278349c98aacd0d80bb67f24bdd895..44b01f4b07e651d170f549369006821905110fc0 100644 (file)
@@ -443,7 +443,7 @@ static int pci9111_ai_do_cmd_test(struct comedi_device *dev,
                i8253_cascade_ns_to_timer_2div(PCI9111_8254_CLOCK_PERIOD_NS,
                                               &dev_private->div1,
                                               &dev_private->div2,
-                                              &(cmd->convert_arg),
+                                              &cmd->convert_arg,
                                               cmd->flags & TRIG_ROUND_MASK);
                if (tmp != cmd->convert_arg)
                        error++;
@@ -571,13 +571,6 @@ static int pci9111_ai_do_cmd(struct comedi_device *dev,
        dev_private->scan_delay = 0;
        switch (async_cmd->convert_src) {
        case TRIG_TIMER:
-               i8253_cascade_ns_to_timer_2div(PCI9111_8254_CLOCK_PERIOD_NS,
-                                              &dev_private->div1,
-                                              &dev_private->div2,
-                                              &(async_cmd->convert_arg),
-                                              async_cmd->
-                                              flags & TRIG_ROUND_MASK);
-
                pci9111_trigger_source_set(dev, software);
                pci9111_timer_set(dev);
                pci9111_fifo_reset(dev);