Commit bf4683bd authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: remove thisboard macro in the comedi_test driver

The 'thisboard' macro depends on having a local variable with
a magic name. The CodingStyle document suggests not doing this
to avoid confusion. Remove the macro and use the comedi_board()
inline helper to get the dev->board_ptr information.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d493f213
......@@ -67,8 +67,6 @@ struct waveform_board {
#define N_CHANS 8
#define thisboard ((const struct waveform_board *)dev->board_ptr)
/* Data unique to this driver */
struct waveform_private {
struct timer_list timer;
......@@ -429,12 +427,13 @@ static int waveform_ao_insn_write(struct comedi_device *dev,
static int waveform_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
const struct waveform_board *board = comedi_board(dev);
struct comedi_subdevice *s;
int amplitude = it->options[0];
int period = it->options[1];
int i;
dev->board_name = thisboard->name;
dev->board_name = board->name;
if (alloc_private(dev, sizeof(struct waveform_private)) < 0)
return -ENOMEM;
......@@ -457,8 +456,8 @@ static int waveform_attach(struct comedi_device *dev,
/* analog input subdevice */
s->type = COMEDI_SUBD_AI;
s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_CMD_READ;
s->n_chan = thisboard->ai_chans;
s->maxdata = (1 << thisboard->ai_bits) - 1;
s->n_chan = board->ai_chans;
s->maxdata = (1 << board->ai_bits) - 1;
s->range_table = &waveform_ai_ranges;
s->len_chanlist = s->n_chan * 2;
s->insn_read = waveform_ai_insn_read;
......@@ -471,8 +470,8 @@ static int waveform_attach(struct comedi_device *dev,
/* analog output subdevice (loopback) */
s->type = COMEDI_SUBD_AO;
s->subdev_flags = SDF_WRITEABLE | SDF_GROUND;
s->n_chan = thisboard->ai_chans;
s->maxdata = (1 << thisboard->ai_bits) - 1;
s->n_chan = board->ai_chans;
s->maxdata = (1 << board->ai_bits) - 1;
s->range_table = &waveform_ai_ranges;
s->len_chanlist = s->n_chan * 2;
s->insn_write = waveform_ao_insn_write;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment