[PATCH 21/32] staging: comedi: das08: rename DAS08AO_AO_LSB() and DAS08AO_AO_MSB()

From: Ian Abbott
Date: Fri Jun 05 2015 - 13:34:43 EST


The `DAS08AO_AO_LSB(x)` macro returns the offset to the analog output
low byte register for channel x (0 or 1) for "AOL", "AOM", and "AOH"
boards. The `DAS08AO_AO_MSB(x)` macro returns the offset to the
corresponding high byte register. Rename the macros to
`DAS08AOX_AO_LSB_REG(x)` and `DAS08AOX_AO_MSB_REG(x)` respectively, and
add some comments.

Signed-off-by: Ian Abbott <abbotti@xxxxxxxxx>
---
drivers/staging/comedi/drivers/das08.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index 8aa8011..005a7ef 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -134,8 +134,10 @@
cdef 8255
*/

-#define DAS08AO_AO_LSB(x) ((x) ? 0xa : 8)
-#define DAS08AO_AO_MSB(x) ((x) ? 0xb : 9)
+/* (W) analog output l.s.b. registers for 2 channels ("AOx" boards) */
+#define DAS08AOX_AO_LSB_REG(x) ((x) ? 0x0a : 0x08)
+/* (W) analog output m.s.b. registers for 2 channels ("AOx" boards) */
+#define DAS08AOX_AO_MSB_REG(x) ((x) ? 0x0b : 0x09)
#define DAS08AO_AO_UPDATE 8

/* gainlist same as _pgx_ below */
@@ -369,8 +371,8 @@ static void das08_ao_set_data(struct comedi_device *dev,
/* load DACs */
inb(dev->iobase + DAS08JR_AO_UPDATE_REG);
} else {
- outb(lsb, dev->iobase + DAS08AO_AO_LSB(chan));
- outb(msb, dev->iobase + DAS08AO_AO_MSB(chan));
+ outb(lsb, dev->iobase + DAS08AOX_AO_LSB_REG(chan));
+ outb(msb, dev->iobase + DAS08AOX_AO_MSB_REG(chan));
/* load DACs */
inb(dev->iobase + DAS08AO_AO_UPDATE);
}
--
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/