Skip to content

Commit

Permalink
staging: comedi: das800: rename 'thisboard' variables
Browse files Browse the repository at this point in the history
For aesthetics, rename the 'thisboard' variables to 'board'. That name
is more commonly used for the boardinfo pointer in comedi drivers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: 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 Jun 19, 2015
1 parent a69153f commit 4f3aa18
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions drivers/staging/comedi/drivers/das800.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,13 @@ static unsigned das800_ind_read(struct comedi_device *dev, unsigned reg)

static void das800_enable(struct comedi_device *dev)
{
const struct das800_board *thisboard = dev->board_ptr;
const struct das800_board *board = dev->board_ptr;
struct das800_private *devpriv = dev->private;
unsigned long irq_flags;

spin_lock_irqsave(&dev->spinlock, irq_flags);
/* enable fifo-half full interrupts for cio-das802/16 */
if (thisboard->resolution == 16)
if (board->resolution == 16)
outb(CIO_ENHF, dev->iobase + DAS800_GAIN);
/* enable hardware triggering */
das800_ind_write(dev, CONV_HCEN, CONV_CONTROL);
Expand Down Expand Up @@ -303,7 +303,7 @@ static int das800_ai_do_cmdtest(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_cmd *cmd)
{
const struct das800_board *thisboard = dev->board_ptr;
const struct das800_board *board = dev->board_ptr;
int err = 0;

/* Step 1 : check if triggers are trivially valid */
Expand Down Expand Up @@ -335,7 +335,7 @@ static int das800_ai_do_cmdtest(struct comedi_device *dev,

if (cmd->convert_src == TRIG_TIMER) {
err |= comedi_check_trigger_arg_min(&cmd->convert_arg,
thisboard->ai_speed);
board->ai_speed);
}

err |= comedi_check_trigger_arg_min(&cmd->chanlist_len, 1);
Expand Down Expand Up @@ -375,7 +375,7 @@ static int das800_ai_do_cmdtest(struct comedi_device *dev,
static int das800_ai_do_cmd(struct comedi_device *dev,
struct comedi_subdevice *s)
{
const struct das800_board *thisboard = dev->board_ptr;
const struct das800_board *board = dev->board_ptr;
struct comedi_async *async = s->async;
struct comedi_cmd *cmd = &async->cmd;
unsigned int gain = CR_RANGE(cmd->chanlist[0]);
Expand All @@ -393,7 +393,7 @@ static int das800_ai_do_cmd(struct comedi_device *dev,
spin_unlock_irqrestore(&dev->spinlock, irq_flags);

/* set gain */
if (thisboard->resolution == 12 && gain > 0)
if (board->resolution == 12 && gain > 0)
gain += 0x7;
gain &= 0xf;
outb(gain, dev->iobase + DAS800_GAIN);
Expand Down Expand Up @@ -606,8 +606,8 @@ static int das800_do_insn_bits(struct comedi_device *dev,

static const struct das800_board *das800_probe(struct comedi_device *dev)
{
const struct das800_board *thisboard = dev->board_ptr;
int index = thisboard ? thisboard - das800_boards : -EINVAL;
const struct das800_board *board = dev->board_ptr;
int index = board ? board - das800_boards : -EINVAL;
int id_bits;
unsigned long irq_flags;

Expand All @@ -628,18 +628,18 @@ static const struct das800_board *das800_probe(struct comedi_device *dev)
switch (id_bits) {
case 0x0:
if (index == BOARD_DAS800 || index == BOARD_CIODAS800)
return thisboard;
return board;
index = BOARD_DAS800;
break;
case 0x2:
if (index == BOARD_DAS801 || index == BOARD_CIODAS801)
return thisboard;
return board;
index = BOARD_DAS801;
break;
case 0x3:
if (index == BOARD_DAS802 || index == BOARD_CIODAS802 ||
index == BOARD_CIODAS80216)
return thisboard;
return board;
index = BOARD_DAS802;
break;
default:
Expand All @@ -655,7 +655,7 @@ static const struct das800_board *das800_probe(struct comedi_device *dev)

static int das800_attach(struct comedi_device *dev, struct comedi_devconfig *it)
{
const struct das800_board *thisboard;
const struct das800_board *board;
struct das800_private *devpriv;
struct comedi_subdevice *s;
unsigned int irq = it->options[1];
Expand All @@ -670,11 +670,11 @@ static int das800_attach(struct comedi_device *dev, struct comedi_devconfig *it)
if (ret)
return ret;

thisboard = das800_probe(dev);
if (!thisboard)
board = das800_probe(dev);
if (!board)
return -ENODEV;
dev->board_ptr = thisboard;
dev->board_name = thisboard->name;
dev->board_ptr = board;
dev->board_name = board->name;

if (irq > 1 && irq <= 7) {
ret = request_irq(irq, das800_interrupt, 0, dev->board_name,
Expand All @@ -698,8 +698,8 @@ static int das800_attach(struct comedi_device *dev, struct comedi_devconfig *it)
s->type = COMEDI_SUBD_AI;
s->subdev_flags = SDF_READABLE | SDF_GROUND;
s->n_chan = 8;
s->maxdata = (1 << thisboard->resolution) - 1;
s->range_table = thisboard->ai_range;
s->maxdata = (1 << board->resolution) - 1;
s->range_table = board->ai_range;
s->insn_read = das800_ai_insn_read;
if (dev->irq) {
s->subdev_flags |= SDF_CMD_READ;
Expand Down

0 comments on commit 4f3aa18

Please sign in to comment.