Commit c7f53ea1 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: amplc_pci224: 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: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent dbc855ad
...@@ -385,14 +385,14 @@ static void ...@@ -385,14 +385,14 @@ static void
pci224_ao_set_data(struct comedi_device *dev, int chan, int range, pci224_ao_set_data(struct comedi_device *dev, int chan, int range,
unsigned int data) unsigned int data)
{ {
const struct pci224_board *thisboard = dev->board_ptr; const struct pci224_board *board = dev->board_ptr;
struct pci224_private *devpriv = dev->private; struct pci224_private *devpriv = dev->private;
unsigned short mangled; unsigned short mangled;
/* Enable the channel. */ /* Enable the channel. */
outw(1 << chan, dev->iobase + PCI224_DACCEN); outw(1 << chan, dev->iobase + PCI224_DACCEN);
/* Set range and reset FIFO. */ /* Set range and reset FIFO. */
devpriv->daccon = COMBINE(devpriv->daccon, thisboard->ao_hwrange[range], devpriv->daccon = COMBINE(devpriv->daccon, board->ao_hwrange[range],
PCI224_DACCON_POLAR_MASK | PCI224_DACCON_POLAR_MASK |
PCI224_DACCON_VREF_MASK); PCI224_DACCON_VREF_MASK);
outw(devpriv->daccon | PCI224_DACCON_FIFORESET, outw(devpriv->daccon | PCI224_DACCON_FIFORESET,
...@@ -402,7 +402,7 @@ pci224_ao_set_data(struct comedi_device *dev, int chan, int range, ...@@ -402,7 +402,7 @@ pci224_ao_set_data(struct comedi_device *dev, int chan, int range,
* - bipolar: 16-bit 2's complement * - bipolar: 16-bit 2's complement
* - unipolar: 16-bit unsigned * - unipolar: 16-bit unsigned
*/ */
mangled = (unsigned short)data << (16 - thisboard->ao_bits); mangled = (unsigned short)data << (16 - board->ao_bits);
if ((devpriv->daccon & PCI224_DACCON_POLAR_MASK) == if ((devpriv->daccon & PCI224_DACCON_POLAR_MASK) ==
PCI224_DACCON_POLAR_BI) { PCI224_DACCON_POLAR_BI) {
mangled ^= 0x8000; mangled ^= 0x8000;
...@@ -620,12 +620,12 @@ static int pci224_ao_check_chanlist(struct comedi_device *dev, ...@@ -620,12 +620,12 @@ static int pci224_ao_check_chanlist(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_subdevice *s,
struct comedi_cmd *cmd) struct comedi_cmd *cmd)
{ {
const struct pci224_board *thisboard = dev->board_ptr; const struct pci224_board *board = dev->board_ptr;
unsigned int range_check_0; unsigned int range_check_0;
unsigned int chan_mask = 0; unsigned int chan_mask = 0;
int i; int i;
range_check_0 = thisboard->ao_range_check[CR_RANGE(cmd->chanlist[0])]; range_check_0 = board->ao_range_check[CR_RANGE(cmd->chanlist[0])];
for (i = 0; i < cmd->chanlist_len; i++) { for (i = 0; i < cmd->chanlist_len; i++) {
unsigned int chan = CR_CHAN(cmd->chanlist[i]); unsigned int chan = CR_CHAN(cmd->chanlist[i]);
...@@ -637,7 +637,7 @@ static int pci224_ao_check_chanlist(struct comedi_device *dev, ...@@ -637,7 +637,7 @@ static int pci224_ao_check_chanlist(struct comedi_device *dev,
} }
chan_mask |= 1 << chan; chan_mask |= 1 << chan;
if (thisboard->ao_range_check[CR_RANGE(cmd->chanlist[i])] != if (board->ao_range_check[CR_RANGE(cmd->chanlist[i])] !=
range_check_0) { range_check_0) {
dev_dbg(dev->class_dev, dev_dbg(dev->class_dev,
"%s: entries in chanlist have incompatible ranges\n", "%s: entries in chanlist have incompatible ranges\n",
...@@ -826,7 +826,7 @@ static void pci224_ao_start_pacer(struct comedi_device *dev, ...@@ -826,7 +826,7 @@ static void pci224_ao_start_pacer(struct comedi_device *dev,
static int pci224_ao_cmd(struct comedi_device *dev, struct comedi_subdevice *s) static int pci224_ao_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
{ {
const struct pci224_board *thisboard = dev->board_ptr; const struct pci224_board *board = dev->board_ptr;
struct pci224_private *devpriv = dev->private; struct pci224_private *devpriv = dev->private;
struct comedi_cmd *cmd = &s->async->cmd; struct comedi_cmd *cmd = &s->async->cmd;
int range; int range;
...@@ -869,7 +869,7 @@ static int pci224_ao_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -869,7 +869,7 @@ static int pci224_ao_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
*/ */
devpriv->daccon = devpriv->daccon =
COMBINE(devpriv->daccon, COMBINE(devpriv->daccon,
thisboard->ao_hwrange[range] | PCI224_DACCON_TRIG_NONE | board->ao_hwrange[range] | PCI224_DACCON_TRIG_NONE |
PCI224_DACCON_FIFOINTR_NHALF, PCI224_DACCON_FIFOINTR_NHALF,
PCI224_DACCON_POLAR_MASK | PCI224_DACCON_VREF_MASK | PCI224_DACCON_POLAR_MASK | PCI224_DACCON_VREF_MASK |
PCI224_DACCON_TRIG_MASK | PCI224_DACCON_FIFOINTR_MASK); PCI224_DACCON_TRIG_MASK | PCI224_DACCON_FIFOINTR_MASK);
...@@ -911,7 +911,7 @@ static void ...@@ -911,7 +911,7 @@ static void
pci224_ao_munge(struct comedi_device *dev, struct comedi_subdevice *s, pci224_ao_munge(struct comedi_device *dev, struct comedi_subdevice *s,
void *data, unsigned int num_bytes, unsigned int chan_index) void *data, unsigned int num_bytes, unsigned int chan_index)
{ {
const struct pci224_board *thisboard = dev->board_ptr; const struct pci224_board *board = dev->board_ptr;
struct comedi_cmd *cmd = &s->async->cmd; struct comedi_cmd *cmd = &s->async->cmd;
unsigned short *array = data; unsigned short *array = data;
unsigned int length = num_bytes / sizeof(*array); unsigned int length = num_bytes / sizeof(*array);
...@@ -920,9 +920,9 @@ pci224_ao_munge(struct comedi_device *dev, struct comedi_subdevice *s, ...@@ -920,9 +920,9 @@ pci224_ao_munge(struct comedi_device *dev, struct comedi_subdevice *s,
unsigned int i; unsigned int i;
/* The hardware expects 16-bit numbers. */ /* The hardware expects 16-bit numbers. */
shift = 16 - thisboard->ao_bits; shift = 16 - board->ao_bits;
/* Channels will be all bipolar or all unipolar. */ /* Channels will be all bipolar or all unipolar. */
if ((thisboard->ao_hwrange[CR_RANGE(cmd->chanlist[0])] & if ((board->ao_hwrange[CR_RANGE(cmd->chanlist[0])] &
PCI224_DACCON_POLAR_MASK) == PCI224_DACCON_POLAR_UNI) { PCI224_DACCON_POLAR_MASK) == PCI224_DACCON_POLAR_UNI) {
/* Unipolar */ /* Unipolar */
offset = 0; offset = 0;
...@@ -988,21 +988,21 @@ static int ...@@ -988,21 +988,21 @@ static int
pci224_auto_attach(struct comedi_device *dev, unsigned long context_model) pci224_auto_attach(struct comedi_device *dev, unsigned long context_model)
{ {
struct pci_dev *pci_dev = comedi_to_pci_dev(dev); struct pci_dev *pci_dev = comedi_to_pci_dev(dev);
const struct pci224_board *thisboard = NULL; const struct pci224_board *board = NULL;
struct pci224_private *devpriv; struct pci224_private *devpriv;
struct comedi_subdevice *s; struct comedi_subdevice *s;
unsigned int irq; unsigned int irq;
int ret; int ret;
if (context_model < ARRAY_SIZE(pci224_boards)) if (context_model < ARRAY_SIZE(pci224_boards))
thisboard = &pci224_boards[context_model]; board = &pci224_boards[context_model];
if (!thisboard || !thisboard->name) { if (!board || !board->name) {
dev_err(dev->class_dev, dev_err(dev->class_dev,
"amplc_pci224: BUG! cannot determine board type!\n"); "amplc_pci224: BUG! cannot determine board type!\n");
return -EINVAL; return -EINVAL;
} }
dev->board_ptr = thisboard; dev->board_ptr = board;
dev->board_name = thisboard->name; dev->board_name = board->name;
dev_info(dev->class_dev, "amplc_pci224: attach pci %s - %s\n", dev_info(dev->class_dev, "amplc_pci224: attach pci %s - %s\n",
pci_name(pci_dev), dev->board_name); pci_name(pci_dev), dev->board_name);
...@@ -1023,13 +1023,13 @@ pci224_auto_attach(struct comedi_device *dev, unsigned long context_model) ...@@ -1023,13 +1023,13 @@ pci224_auto_attach(struct comedi_device *dev, unsigned long context_model)
/* Allocate buffer to hold values for AO channel scan. */ /* Allocate buffer to hold values for AO channel scan. */
devpriv->ao_scan_vals = kmalloc(sizeof(devpriv->ao_scan_vals[0]) * devpriv->ao_scan_vals = kmalloc(sizeof(devpriv->ao_scan_vals[0]) *
thisboard->ao_chans, GFP_KERNEL); board->ao_chans, GFP_KERNEL);
if (!devpriv->ao_scan_vals) if (!devpriv->ao_scan_vals)
return -ENOMEM; return -ENOMEM;
/* Allocate buffer to hold AO channel scan order. */ /* Allocate buffer to hold AO channel scan order. */
devpriv->ao_scan_order = kmalloc(sizeof(devpriv->ao_scan_order[0]) * devpriv->ao_scan_order = kmalloc(sizeof(devpriv->ao_scan_order[0]) *
thisboard->ao_chans, GFP_KERNEL); board->ao_chans, GFP_KERNEL);
if (!devpriv->ao_scan_order) if (!devpriv->ao_scan_order)
return -ENOMEM; return -ENOMEM;
...@@ -1059,9 +1059,9 @@ pci224_auto_attach(struct comedi_device *dev, unsigned long context_model) ...@@ -1059,9 +1059,9 @@ pci224_auto_attach(struct comedi_device *dev, unsigned long context_model)
/* Analog output subdevice. */ /* Analog output subdevice. */
s->type = COMEDI_SUBD_AO; s->type = COMEDI_SUBD_AO;
s->subdev_flags = SDF_WRITABLE | SDF_GROUND | SDF_CMD_WRITE; s->subdev_flags = SDF_WRITABLE | SDF_GROUND | SDF_CMD_WRITE;
s->n_chan = thisboard->ao_chans; s->n_chan = board->ao_chans;
s->maxdata = (1 << thisboard->ao_bits) - 1; s->maxdata = (1 << board->ao_bits) - 1;
s->range_table = thisboard->ao_range; s->range_table = board->ao_range;
s->insn_write = pci224_ao_insn_write; s->insn_write = pci224_ao_insn_write;
s->len_chanlist = s->n_chan; s->len_chanlist = s->n_chan;
dev->write_subdev = s; dev->write_subdev = s;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment