[PATCH 45/46] staging: comedi: adl_pci9111: remove extra i8253_cascade_ns_to_timer_2div()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/drivers/adl_pci9111.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adl_pci9111.c b/drivers/staging/comedi/drivers/adl_pci9111.c
index 3d25253..21e7965 100644
--- a/drivers/staging/comedi/drivers/adl_pci9111.c
+++ b/drivers/staging/comedi/drivers/adl_pci9111.c
@@ -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);
-- 
1.7.11

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux