[PATCH 17/19] staging: comedi: cb_pcidda: cleanup DADATA define

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

 



Rename the define used for the D/A Data register so that is has
namespace with this driver. Change the define so that it takes
the channel as a parameter to calculate the correct register
offset.

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

diff --git a/drivers/staging/comedi/drivers/cb_pcidda.c b/drivers/staging/comedi/drivers/cb_pcidda.c
index 90930c8..6b69e53 100644
--- a/drivers/staging/comedi/drivers/cb_pcidda.c
+++ b/drivers/staging/comedi/drivers/cb_pcidda.c
@@ -97,7 +97,7 @@
 /* manual says to set this bit with no explanation */
 #define DUMMY_BIT       0x40
 
-#define DADATA	8		/*  FIRST D/A DATA REGISTER (0) */
+#define CB_DDA_DA_DATA_REG(x)		(0x08 + ((x) * 2))
 
 static const struct comedi_lrange cb_pcidda_ranges = {
 	6, {
@@ -393,7 +393,7 @@ static int cb_pcidda_ao_winsn(struct comedi_device *dev,
 	outw(ctrl, dev->iobase + CB_DDA_DA_CTRL_REG);
 
 	/* write data */
-	outw(data[0], dev->iobase + DADATA + channel * 2);
+	outw(data[0], dev->iobase + CB_DDA_DA_DATA_REG(channel));
 
 	/* return the number of samples read/written */
 	return 1;
-- 
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