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: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d493f213ab
commit
bf4683bdbd
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user