[PATCH 14/15] staging: comedi: hwdrv_apci3501: remove "magic" numbers in apci3501_write_insn_timer()

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

 



Use register bit defines from addi_tcw.h to remove the "magic" numbers.

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

diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c
index c4a72a5..d971f7a 100644
--- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c
+++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c
@@ -93,17 +93,17 @@ static int apci3501_write_insn_timer(struct comedi_device *dev,
 	if (devpriv->timer_mode == ADDIDATA_WATCHDOG ||
 	    devpriv->timer_mode == ADDIDATA_TIMER) {
 		ctrl = inl(devpriv->tcw + ADDI_TCW_CTRL_REG);
-		ctrl &= 0xfffff9ff;
+		ctrl &= ~(ADDI_TCW_CTRL_GATE | ADDI_TCW_CTRL_TRIG);
 
 		if (data[1] == 1) {		/* enable */
-			ctrl |= 0x1;
+			ctrl |= ADDI_TCW_CTRL_ENA;
 		} else if (data[1] == 0) {	/* stop */
 			if (devpriv->timer_mode == ADDIDATA_WATCHDOG)
 				ctrl = 0;
 			else
-				ctrl &= ~0x1;
+				ctrl &= ~ADDI_TCW_CTRL_ENA;
 		} else if (data[1] == 2) {	/* trigger */
-			ctrl |= 0x200;
+			ctrl |= ADDI_TCW_CTRL_TRIG;
 		}
 		outl(ctrl, devpriv->tcw + ADDI_TCW_CTRL_REG);
 	}
-- 
2.4.3

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-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