Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 317097
b: refs/heads/master
c: df9d334
h: refs/heads/master
i:
  317095: cc1d83e
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jun 5, 2012
1 parent 4b13444 commit fda1b48
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 28 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5a011d61ed5ca531470493acf19756fc4e894675
refs/heads/master: df9d33493474a342c866119c28204e0a790de5c0
39 changes: 12 additions & 27 deletions trunk/drivers/staging/comedi/drivers/dmm32at.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,6 @@ static const struct dmm32at_board dmm32at_boards[] = {
},
};

/*
* Useful for shorthand access to the particular board structure
*/
#define thisboard ((const struct dmm32at_board *)dev->board_ptr)

/* this structure is for data unique to this hardware driver. If
* several hardware drivers keep similar information in this structure,
* feel free to suggest moving the variable to the struct comedi_device struct.
Expand Down Expand Up @@ -290,6 +285,7 @@ void dmm32at_setaitimer(struct comedi_device *dev, unsigned int nansec);
static int dmm32at_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
const struct dmm32at_board *board = comedi_board(dev);
int ret;
struct comedi_subdevice *s;
unsigned char aihi, ailo, fifostat, aistat, intstat, airback;
Expand All @@ -304,7 +300,7 @@ static int dmm32at_attach(struct comedi_device *dev,
iobase, irq);

/* register address space */
if (!request_region(iobase, DMM32AT_MEMSIZE, thisboard->name)) {
if (!request_region(iobase, DMM32AT_MEMSIZE, board->name)) {
printk(KERN_ERR "comedi%d: dmm32at: I/O port conflict\n",
dev->minor);
return -EIO;
Expand Down Expand Up @@ -358,26 +354,15 @@ static int dmm32at_attach(struct comedi_device *dev,

/* board is there, register interrupt */
if (irq) {
ret = request_irq(irq, dmm32at_isr, 0, thisboard->name, dev);
ret = request_irq(irq, dmm32at_isr, 0, board->name, dev);
if (ret < 0) {
printk(KERN_ERR "dmm32at: irq conflict\n");
return ret;
}
dev->irq = irq;
}

/*
* If you can probe the device to determine what device in a series
* it is, this is the place to do it. Otherwise, dev->board_ptr
* should already be initialized.
*/
/* dev->board_ptr = dmm32at_probe(dev); */

/*
* Initialize dev->board_name. Note that we can use the "thisboard"
* macro now, since we just initialized it in the last line.
*/
dev->board_name = thisboard->name;
dev->board_name = board->name;

/*
* Allocate the private structure area. alloc_private() is a
Expand All @@ -399,9 +384,9 @@ static int dmm32at_attach(struct comedi_device *dev,
s->type = COMEDI_SUBD_AI;
/* we support single-ended (ground) and differential */
s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_DIFF | SDF_CMD_READ;
s->n_chan = thisboard->ai_chans;
s->maxdata = (1 << thisboard->ai_bits) - 1;
s->range_table = thisboard->ai_ranges;
s->n_chan = board->ai_chans;
s->maxdata = (1 << board->ai_bits) - 1;
s->range_table = board->ai_ranges;
s->len_chanlist = 32; /* This is the maximum chanlist length that
the board can handle */
s->insn_read = dmm32at_ai_rinsn;
Expand All @@ -413,15 +398,15 @@ static int dmm32at_attach(struct comedi_device *dev,
/* analog output subdevice */
s->type = COMEDI_SUBD_AO;
s->subdev_flags = SDF_WRITABLE;
s->n_chan = thisboard->ao_chans;
s->maxdata = (1 << thisboard->ao_bits) - 1;
s->range_table = thisboard->ao_ranges;
s->n_chan = board->ao_chans;
s->maxdata = (1 << board->ao_bits) - 1;
s->range_table = board->ao_ranges;
s->insn_write = dmm32at_ao_winsn;
s->insn_read = dmm32at_ao_rinsn;

s = dev->subdevices + 2;
/* digital i/o subdevice */
if (thisboard->have_dio) {
if (board->have_dio) {

/* get access to the DIO regs */
dmm_outb(dev, DMM32AT_CNTRL, DMM32AT_DIOACC);
Expand All @@ -433,7 +418,7 @@ static int dmm32at_attach(struct comedi_device *dev,
/* set up the subdevice */
s->type = COMEDI_SUBD_DIO;
s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
s->n_chan = thisboard->dio_chans;
s->n_chan = board->dio_chans;
s->maxdata = 1;
s->state = 0;
s->range_table = &range_digital;
Expand Down

0 comments on commit fda1b48

Please sign in to comment.