mirror of
https://github.com/torvalds/linux.git
synced 2024-12-04 18:13:04 +00:00
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: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
06ad6bd869
commit
8c79825ec8
@ -444,9 +444,9 @@ static const struct comedi_lrange range_ao_2 = {
|
||||
static inline uint16_t munge_bipolar_sample(const struct comedi_device *dev,
|
||||
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;
|
||||
}
|
||||
|
||||
@ -725,7 +725,7 @@ static int das1800_ai_do_cmdtest(struct comedi_device *dev,
|
||||
struct comedi_subdevice *s,
|
||||
struct comedi_cmd *cmd)
|
||||
{
|
||||
const struct das1800_board *thisboard = dev->board_ptr;
|
||||
const struct das1800_board *board = dev->board_ptr;
|
||||
int err = 0;
|
||||
unsigned int arg;
|
||||
|
||||
@ -765,7 +765,7 @@ static int das1800_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);
|
||||
@ -1048,7 +1048,7 @@ static int das1800_ai_rinsn(struct comedi_device *dev,
|
||||
struct comedi_subdevice *s,
|
||||
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 chan, range, aref, chan_range;
|
||||
int timeout = 1000;
|
||||
@ -1098,7 +1098,7 @@ static int das1800_ai_rinsn(struct comedi_device *dev,
|
||||
dpnt = inw(dev->iobase + DAS1800_FIFO);
|
||||
/* shift data to offset binary for bipolar ranges */
|
||||
if ((conv_flags & UB) == 0)
|
||||
dpnt += 1 << (thisboard->resolution - 1);
|
||||
dpnt += 1 << (board->resolution - 1);
|
||||
data[n] = dpnt;
|
||||
}
|
||||
exit:
|
||||
@ -1112,16 +1112,16 @@ static int das1800_ao_winsn(struct comedi_device *dev,
|
||||
struct comedi_subdevice *s,
|
||||
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;
|
||||
int chan = CR_CHAN(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 long irq_flags;
|
||||
|
||||
/* 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 (chan == update_chan)
|
||||
devpriv->ao_update_bits = output;
|
||||
@ -1282,7 +1282,7 @@ static const struct das1800_board *das1800_probe(struct comedi_device *dev)
|
||||
static int das1800_attach(struct comedi_device *dev,
|
||||
struct comedi_devconfig *it)
|
||||
{
|
||||
const struct das1800_board *thisboard;
|
||||
const struct das1800_board *board;
|
||||
struct das1800_private *devpriv;
|
||||
struct comedi_subdevice *s;
|
||||
unsigned int irq = it->options[1];
|
||||
@ -1296,16 +1296,16 @@ static int das1800_attach(struct comedi_device *dev,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
thisboard = das1800_probe(dev);
|
||||
if (!thisboard) {
|
||||
board = das1800_probe(dev);
|
||||
if (!board) {
|
||||
dev_err(dev->class_dev, "unable to determine board type\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
dev->board_ptr = thisboard;
|
||||
dev->board_name = thisboard->name;
|
||||
dev->board_ptr = board;
|
||||
dev->board_name = board->name;
|
||||
|
||||
/* 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;
|
||||
|
||||
ret = __comedi_request_region(dev, iobase2, DAS1800_SIZE);
|
||||
@ -1365,11 +1365,11 @@ static int das1800_attach(struct comedi_device *dev,
|
||||
s = &dev->subdevices[0];
|
||||
s->type = COMEDI_SUBD_AI;
|
||||
s->subdev_flags = SDF_READABLE | SDF_DIFF | SDF_GROUND;
|
||||
if (thisboard->common)
|
||||
if (board->common)
|
||||
s->subdev_flags |= SDF_COMMON;
|
||||
s->n_chan = thisboard->qram_len;
|
||||
s->maxdata = (1 << thisboard->resolution) - 1;
|
||||
s->range_table = thisboard->range_ai;
|
||||
s->n_chan = board->qram_len;
|
||||
s->maxdata = (1 << board->resolution) - 1;
|
||||
s->range_table = board->range_ai;
|
||||
s->insn_read = das1800_ai_rinsn;
|
||||
if (dev->irq) {
|
||||
dev->read_subdev = s;
|
||||
@ -1383,11 +1383,11 @@ static int das1800_attach(struct comedi_device *dev,
|
||||
|
||||
/* analog out */
|
||||
s = &dev->subdevices[1];
|
||||
if (thisboard->ao_ability == 1) {
|
||||
if (board->ao_ability == 1) {
|
||||
s->type = COMEDI_SUBD_AO;
|
||||
s->subdev_flags = SDF_WRITABLE;
|
||||
s->n_chan = thisboard->ao_n_chan;
|
||||
s->maxdata = (1 << thisboard->resolution) - 1;
|
||||
s->n_chan = board->ao_n_chan;
|
||||
s->maxdata = (1 << board->resolution) - 1;
|
||||
s->range_table = &range_bipolar10;
|
||||
s->insn_write = das1800_ao_winsn;
|
||||
} else {
|
||||
@ -1407,7 +1407,7 @@ static int das1800_attach(struct comedi_device *dev,
|
||||
s = &dev->subdevices[3];
|
||||
s->type = COMEDI_SUBD_DO;
|
||||
s->subdev_flags = SDF_WRITABLE;
|
||||
s->n_chan = thisboard->do_n_chan;
|
||||
s->n_chan = board->do_n_chan;
|
||||
s->maxdata = 1;
|
||||
s->range_table = &range_digital;
|
||||
s->insn_bits = das1800_do_wbits;
|
||||
@ -1418,9 +1418,9 @@ static int das1800_attach(struct comedi_device *dev,
|
||||
outb(0, dev->iobase + DAS1800_DIGITAL);
|
||||
|
||||
/* initialize analog out channels */
|
||||
if (thisboard->ao_ability == 1) {
|
||||
if (board->ao_ability == 1) {
|
||||
/* 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);
|
||||
outw(devpriv->ao_update_bits, dev->iobase + DAS1800_DAC);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user