提交 8c79825e 编写于 作者: H H Hartley Sweeten 提交者: Greg Kroah-Hartman

staging: comedi: das1800: rename 'thisboard' variables

For aesthetics, rename the 'thisboard' variables to 'board'. That name
is more commonly used for the boardinfo pointer in comedi drivers.
Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: NIan Abbott <abbotti@mev.co.uk>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 06ad6bd8
...@@ -444,9 +444,9 @@ static const struct comedi_lrange range_ao_2 = { ...@@ -444,9 +444,9 @@ static const struct comedi_lrange range_ao_2 = {
static inline uint16_t munge_bipolar_sample(const struct comedi_device *dev, static inline uint16_t munge_bipolar_sample(const struct comedi_device *dev,
uint16_t sample) uint16_t sample)
{ {
const struct das1800_board *thisboard = dev->board_ptr; const struct das1800_board *board = dev->board_ptr;
sample += 1 << (thisboard->resolution - 1); sample += 1 << (board->resolution - 1);
return sample; return sample;
} }
...@@ -725,7 +725,7 @@ static int das1800_ai_do_cmdtest(struct comedi_device *dev, ...@@ -725,7 +725,7 @@ static int das1800_ai_do_cmdtest(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_subdevice *s,
struct comedi_cmd *cmd) struct comedi_cmd *cmd)
{ {
const struct das1800_board *thisboard = dev->board_ptr; const struct das1800_board *board = dev->board_ptr;
int err = 0; int err = 0;
unsigned int arg; unsigned int arg;
...@@ -765,7 +765,7 @@ static int das1800_ai_do_cmdtest(struct comedi_device *dev, ...@@ -765,7 +765,7 @@ static int das1800_ai_do_cmdtest(struct comedi_device *dev,
if (cmd->convert_src == TRIG_TIMER) { if (cmd->convert_src == TRIG_TIMER) {
err |= comedi_check_trigger_arg_min(&cmd->convert_arg, 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); err |= comedi_check_trigger_arg_min(&cmd->chanlist_len, 1);
...@@ -1048,7 +1048,7 @@ static int das1800_ai_rinsn(struct comedi_device *dev, ...@@ -1048,7 +1048,7 @@ static int das1800_ai_rinsn(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data) struct comedi_insn *insn, unsigned int *data)
{ {
const struct das1800_board *thisboard = dev->board_ptr; const struct das1800_board *board = dev->board_ptr;
int i, n; int i, n;
int chan, range, aref, chan_range; int chan, range, aref, chan_range;
int timeout = 1000; int timeout = 1000;
...@@ -1098,7 +1098,7 @@ static int das1800_ai_rinsn(struct comedi_device *dev, ...@@ -1098,7 +1098,7 @@ static int das1800_ai_rinsn(struct comedi_device *dev,
dpnt = inw(dev->iobase + DAS1800_FIFO); dpnt = inw(dev->iobase + DAS1800_FIFO);
/* shift data to offset binary for bipolar ranges */ /* shift data to offset binary for bipolar ranges */
if ((conv_flags & UB) == 0) if ((conv_flags & UB) == 0)
dpnt += 1 << (thisboard->resolution - 1); dpnt += 1 << (board->resolution - 1);
data[n] = dpnt; data[n] = dpnt;
} }
exit: exit:
...@@ -1112,16 +1112,16 @@ static int das1800_ao_winsn(struct comedi_device *dev, ...@@ -1112,16 +1112,16 @@ static int das1800_ao_winsn(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data) struct comedi_insn *insn, unsigned int *data)
{ {
const struct das1800_board *thisboard = dev->board_ptr; const struct das1800_board *board = dev->board_ptr;
struct das1800_private *devpriv = dev->private; struct das1800_private *devpriv = dev->private;
int chan = CR_CHAN(insn->chanspec); int chan = CR_CHAN(insn->chanspec);
/* int range = CR_RANGE(insn->chanspec); */ /* int range = CR_RANGE(insn->chanspec); */
int update_chan = thisboard->ao_n_chan - 1; int update_chan = board->ao_n_chan - 1;
unsigned short output; unsigned short output;
unsigned long irq_flags; unsigned long irq_flags;
/* card expects two's complement data */ /* card expects two's complement data */
output = data[0] - (1 << (thisboard->resolution - 1)); output = data[0] - (1 << (board->resolution - 1));
/* if the write is to the 'update' channel, we need to remember its value */ /* if the write is to the 'update' channel, we need to remember its value */
if (chan == update_chan) if (chan == update_chan)
devpriv->ao_update_bits = output; devpriv->ao_update_bits = output;
...@@ -1282,7 +1282,7 @@ static const struct das1800_board *das1800_probe(struct comedi_device *dev) ...@@ -1282,7 +1282,7 @@ static const struct das1800_board *das1800_probe(struct comedi_device *dev)
static int das1800_attach(struct comedi_device *dev, static int das1800_attach(struct comedi_device *dev,
struct comedi_devconfig *it) struct comedi_devconfig *it)
{ {
const struct das1800_board *thisboard; const struct das1800_board *board;
struct das1800_private *devpriv; struct das1800_private *devpriv;
struct comedi_subdevice *s; struct comedi_subdevice *s;
unsigned int irq = it->options[1]; unsigned int irq = it->options[1];
...@@ -1296,16 +1296,16 @@ static int das1800_attach(struct comedi_device *dev, ...@@ -1296,16 +1296,16 @@ static int das1800_attach(struct comedi_device *dev,
if (ret) if (ret)
return ret; return ret;
thisboard = das1800_probe(dev); board = das1800_probe(dev);
if (!thisboard) { if (!board) {
dev_err(dev->class_dev, "unable to determine board type\n"); dev_err(dev->class_dev, "unable to determine board type\n");
return -ENODEV; return -ENODEV;
} }
dev->board_ptr = thisboard; dev->board_ptr = board;
dev->board_name = thisboard->name; dev->board_name = board->name;
/* if it is an 'ao' board with fancy analog out then we need extra io ports */ /* if it is an 'ao' board with fancy analog out then we need extra io ports */
if (thisboard->ao_ability == 2) { if (board->ao_ability == 2) {
unsigned long iobase2 = dev->iobase + IOBASE2; unsigned long iobase2 = dev->iobase + IOBASE2;
ret = __comedi_request_region(dev, iobase2, DAS1800_SIZE); ret = __comedi_request_region(dev, iobase2, DAS1800_SIZE);
...@@ -1365,11 +1365,11 @@ static int das1800_attach(struct comedi_device *dev, ...@@ -1365,11 +1365,11 @@ static int das1800_attach(struct comedi_device *dev,
s = &dev->subdevices[0]; s = &dev->subdevices[0];
s->type = COMEDI_SUBD_AI; s->type = COMEDI_SUBD_AI;
s->subdev_flags = SDF_READABLE | SDF_DIFF | SDF_GROUND; s->subdev_flags = SDF_READABLE | SDF_DIFF | SDF_GROUND;
if (thisboard->common) if (board->common)
s->subdev_flags |= SDF_COMMON; s->subdev_flags |= SDF_COMMON;
s->n_chan = thisboard->qram_len; s->n_chan = board->qram_len;
s->maxdata = (1 << thisboard->resolution) - 1; s->maxdata = (1 << board->resolution) - 1;
s->range_table = thisboard->range_ai; s->range_table = board->range_ai;
s->insn_read = das1800_ai_rinsn; s->insn_read = das1800_ai_rinsn;
if (dev->irq) { if (dev->irq) {
dev->read_subdev = s; dev->read_subdev = s;
...@@ -1383,11 +1383,11 @@ static int das1800_attach(struct comedi_device *dev, ...@@ -1383,11 +1383,11 @@ static int das1800_attach(struct comedi_device *dev,
/* analog out */ /* analog out */
s = &dev->subdevices[1]; s = &dev->subdevices[1];
if (thisboard->ao_ability == 1) { if (board->ao_ability == 1) {
s->type = COMEDI_SUBD_AO; s->type = COMEDI_SUBD_AO;
s->subdev_flags = SDF_WRITABLE; s->subdev_flags = SDF_WRITABLE;
s->n_chan = thisboard->ao_n_chan; s->n_chan = board->ao_n_chan;
s->maxdata = (1 << thisboard->resolution) - 1; s->maxdata = (1 << board->resolution) - 1;
s->range_table = &range_bipolar10; s->range_table = &range_bipolar10;
s->insn_write = das1800_ao_winsn; s->insn_write = das1800_ao_winsn;
} else { } else {
...@@ -1407,7 +1407,7 @@ static int das1800_attach(struct comedi_device *dev, ...@@ -1407,7 +1407,7 @@ static int das1800_attach(struct comedi_device *dev,
s = &dev->subdevices[3]; s = &dev->subdevices[3];
s->type = COMEDI_SUBD_DO; s->type = COMEDI_SUBD_DO;
s->subdev_flags = SDF_WRITABLE; s->subdev_flags = SDF_WRITABLE;
s->n_chan = thisboard->do_n_chan; s->n_chan = board->do_n_chan;
s->maxdata = 1; s->maxdata = 1;
s->range_table = &range_digital; s->range_table = &range_digital;
s->insn_bits = das1800_do_wbits; s->insn_bits = das1800_do_wbits;
...@@ -1418,9 +1418,9 @@ static int das1800_attach(struct comedi_device *dev, ...@@ -1418,9 +1418,9 @@ static int das1800_attach(struct comedi_device *dev,
outb(0, dev->iobase + DAS1800_DIGITAL); outb(0, dev->iobase + DAS1800_DIGITAL);
/* initialize analog out channels */ /* initialize analog out channels */
if (thisboard->ao_ability == 1) { if (board->ao_ability == 1) {
/* select 'update' dac channel for baseAddress + 0x0 */ /* select 'update' dac channel for baseAddress + 0x0 */
outb(DAC(thisboard->ao_n_chan - 1), outb(DAC(board->ao_n_chan - 1),
dev->iobase + DAS1800_SELECT); dev->iobase + DAS1800_SELECT);
outw(devpriv->ao_update_bits, dev->iobase + DAS1800_DAC); outw(devpriv->ao_update_bits, dev->iobase + DAS1800_DAC);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册