lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1433525435-12986-18-git-send-email-abbotti@mev.co.uk>
Date:	Fri,  5 Jun 2015 18:30:20 +0100
From:	Ian Abbott <abbotti@....co.uk>
To:	<driverdev-devel@...uxdriverproject.org>
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Ian Abbott <abbotti@....co.uk>,
	H Hartley Sweeten <hsweeten@...ionengravers.com>,
	<linux-kernel@...r.kernel.org>
Subject: [PATCH 17/32] staging: comedi: das08: rename and split DAS08JR_DIO

The `DAS08JR_DIO` macro contains the offset to the read-only digital
input register and write-only digital output register on the "JR"
boards.  Replace the macro with two new macros (with the same numeric
value) named `DAS08JR_DI_REG` for the digital input register and
`DAS08JR_DO_REG` for the digital output register, and add some comments.

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

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index 76e35d4..c015bb6 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -95,7 +95,8 @@
 
 */
 
-#define DAS08JR_DIO		3
+#define DAS08JR_DI_REG		0x03	/* (R) digital inputs ("JR" boards) */
+#define DAS08JR_DO_REG		0x03	/* (W) digital outputs ("JR" boards) */
 #define DAS08JR_AO_LSB(x)	((x) ? 6 : 4)
 #define DAS08JR_AO_MSB(x)	((x) ? 7 : 5)
 
@@ -324,7 +325,7 @@ static int das08jr_di_rbits(struct comedi_device *dev,
 			    struct comedi_insn *insn, unsigned int *data)
 {
 	data[0] = 0;
-	data[1] = inb(dev->iobase + DAS08JR_DIO);
+	data[1] = inb(dev->iobase + DAS08JR_DI_REG);
 
 	return insn->n;
 }
@@ -335,7 +336,7 @@ static int das08jr_do_wbits(struct comedi_device *dev,
 			    unsigned int *data)
 {
 	if (comedi_dio_update_state(s, data))
-		outb(s->state, dev->iobase + DAS08JR_DIO);
+		outb(s->state, dev->iobase + DAS08JR_DO_REG);
 
 	data[1] = s->state;
 
@@ -355,7 +356,7 @@ static void das08_ao_set_data(struct comedi_device *dev,
 		outb(lsb, dev->iobase + DAS08JR_AO_LSB(chan));
 		outb(msb, dev->iobase + DAS08JR_AO_MSB(chan));
 		/* load DACs */
-		inb(dev->iobase + DAS08JR_DIO);
+		inb(dev->iobase + DAS08JR_DI_REG);
 	} else {
 		outb(lsb, dev->iobase + DAS08AO_AO_LSB(chan));
 		outb(msb, dev->iobase + DAS08AO_AO_MSB(chan));
-- 
2.1.4

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ