Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422768AbbFERfj (ORCPT ); Fri, 5 Jun 2015 13:35:39 -0400 Received: from smtp81.iad3a.emailsrvr.com ([173.203.187.81]:54579 "EHLO smtp81.iad3a.emailsrvr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932935AbbFERbH (ORCPT ); Fri, 5 Jun 2015 13:31:07 -0400 X-Sender-Id: abbotti@mev.co.uk From: Ian Abbott To: Cc: Greg Kroah-Hartman , Ian Abbott , H Hartley Sweeten , Subject: [PATCH 18/32] staging: comedi: das08: rename DAS08JR_AO_LSB() and DAS08JR_AO_MSB() Date: Fri, 5 Jun 2015 18:30:21 +0100 Message-Id: <1433525435-12986-19-git-send-email-abbotti@mev.co.uk> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1433525435-12986-1-git-send-email-abbotti@mev.co.uk> References: <1433525435-12986-1-git-send-email-abbotti@mev.co.uk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1926 Lines: 48 The `DAS08JR_AO_LSB(x)` macro returns the offset to the analog output low byte register for channel x (0 or 1) for "JR" boards with analog output support. The `DAS08JR_AO_MSB(x)` macro returns the offset to the corresponding high byte register. Rename the macros to `DAS08JR_AO_LSB_REG(x)` and `DAS08JR_AO_MSB_REG(x)` respectively, and add some comments. Signed-off-by: Ian Abbott --- 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 c015bb6..51637b1 100644 --- a/drivers/staging/comedi/drivers/das08.c +++ b/drivers/staging/comedi/drivers/das08.c @@ -97,8 +97,10 @@ #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) +/* (W) analog output l.s.b. registers for 2 channels ("JR" boards) */ +#define DAS08JR_AO_LSB_REG(x) ((x) ? 0x06 : 0x04) +/* (W) analog output m.s.b. registers for 2 channels ("JR" boards) */ +#define DAS08JR_AO_MSB_REG(x) ((x) ? 0x07 : 0x05) /* cio-das08_aox.pdf @@ -353,8 +355,8 @@ static void das08_ao_set_data(struct comedi_device *dev, lsb = data & 0xff; msb = (data >> 8) & 0xff; if (thisboard->is_jr) { - outb(lsb, dev->iobase + DAS08JR_AO_LSB(chan)); - outb(msb, dev->iobase + DAS08JR_AO_MSB(chan)); + outb(lsb, dev->iobase + DAS08JR_AO_LSB_REG(chan)); + outb(msb, dev->iobase + DAS08JR_AO_MSB_REG(chan)); /* load DACs */ inb(dev->iobase + DAS08JR_DI_REG); } else { -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/