staging: comedi: remove thisboard macro in the das16m1 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
df9d334934
commit
4c354b492e
|
@ -150,7 +150,6 @@ struct das16m1_private_struct {
|
||||||
unsigned int divisor2; /* divides master clock to obtain conversion speed */
|
unsigned int divisor2; /* divides master clock to obtain conversion speed */
|
||||||
};
|
};
|
||||||
#define devpriv ((struct das16m1_private_struct *)(dev->private))
|
#define devpriv ((struct das16m1_private_struct *)(dev->private))
|
||||||
#define thisboard ((const struct das16m1_board *)(dev->board_ptr))
|
|
||||||
|
|
||||||
static inline short munge_sample(short data)
|
static inline short munge_sample(short data)
|
||||||
{
|
{
|
||||||
|
@ -168,6 +167,7 @@ static void munge_sample_array(short *array, unsigned int num_elements)
|
||||||
static int das16m1_cmd_test(struct comedi_device *dev,
|
static int das16m1_cmd_test(struct comedi_device *dev,
|
||||||
struct comedi_subdevice *s, struct comedi_cmd *cmd)
|
struct comedi_subdevice *s, struct comedi_cmd *cmd)
|
||||||
{
|
{
|
||||||
|
const struct das16m1_board *board = comedi_board(dev);
|
||||||
unsigned int err = 0, tmp, i;
|
unsigned int err = 0, tmp, i;
|
||||||
|
|
||||||
/* make sure triggers are valid */
|
/* make sure triggers are valid */
|
||||||
|
@ -225,8 +225,8 @@ static int das16m1_cmd_test(struct comedi_device *dev,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmd->convert_src == TRIG_TIMER) {
|
if (cmd->convert_src == TRIG_TIMER) {
|
||||||
if (cmd->convert_arg < thisboard->ai_speed) {
|
if (cmd->convert_arg < board->ai_speed) {
|
||||||
cmd->convert_arg = thisboard->ai_speed;
|
cmd->convert_arg = board->ai_speed;
|
||||||
err++;
|
err++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -600,6 +600,7 @@ static int das16m1_irq_bits(unsigned int irq)
|
||||||
static int das16m1_attach(struct comedi_device *dev,
|
static int das16m1_attach(struct comedi_device *dev,
|
||||||
struct comedi_devconfig *it)
|
struct comedi_devconfig *it)
|
||||||
{
|
{
|
||||||
|
const struct das16m1_board *board = comedi_board(dev);
|
||||||
struct comedi_subdevice *s;
|
struct comedi_subdevice *s;
|
||||||
int ret;
|
int ret;
|
||||||
unsigned int irq;
|
unsigned int irq;
|
||||||
|
@ -611,7 +612,7 @@ static int das16m1_attach(struct comedi_device *dev,
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
dev->board_name = thisboard->name;
|
dev->board_name = board->name;
|
||||||
|
|
||||||
if (!request_region(iobase, DAS16M1_SIZE, dev->driver->driver_name)) {
|
if (!request_region(iobase, DAS16M1_SIZE, dev->driver->driver_name)) {
|
||||||
comedi_error(dev, "I/O port conflict\n");
|
comedi_error(dev, "I/O port conflict\n");
|
||||||
|
|
Loading…
Reference in New Issue