Skip to content

Commit

Permalink
staging: comedi: cb_pcidda: cleanup DADATA define
Browse files Browse the repository at this point in the history
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@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Oct 25, 2012
1 parent be2fcdb commit 87c4e2c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/comedi/drivers/cb_pcidda.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 87c4e2c

Please sign in to comment.