Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 363951
b: refs/heads/master
c: 23e79f8
h: refs/heads/master
i:
  363949: 578e335
  363947: f5f8d57
  363943: 1845613
  363935: 0a50104
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Apr 8, 2013
1 parent 2bdf9c5 commit c3ce27c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 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: 3cb65d4d9dfe058c58755d5b371f4d071437a6c1
refs/heads/master: 23e79f81ade338d1ca9283895088b5d0f57bc4df
18 changes: 9 additions & 9 deletions trunk/drivers/staging/comedi/drivers/dt2801.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,6 @@ static const struct dt2801_board boardtypes[] = {
.dabits = 12},
};

#define boardtype (*(const struct dt2801_board *)dev->board_ptr)

struct dt2801_private {

const struct comedi_lrange *dac_range_types[2];
Expand Down Expand Up @@ -592,6 +590,7 @@ static int dt2801_dio_insn_config(struct comedi_device *dev,
*/
static int dt2801_attach(struct comedi_device *dev, struct comedi_devconfig *it)
{
const struct dt2801_board *board = comedi_board(dev);
struct dt2801_private *devpriv;
struct comedi_subdevice *s;
unsigned long iobase;
Expand Down Expand Up @@ -624,7 +623,8 @@ static int dt2801_attach(struct comedi_device *dev, struct comedi_devconfig *it)

havetype:
dev->board_ptr = boardtypes + type;
printk("dt2801: %s at port 0x%lx", boardtype.name, iobase);
board = comedi_board(dev);
printk("dt2801: %s at port 0x%lx", board->name, iobase);

n_ai_chans = probe_number_of_ai_chans(dev);
printk(" (ai channels = %d)\n", n_ai_chans);
Expand All @@ -638,7 +638,7 @@ static int dt2801_attach(struct comedi_device *dev, struct comedi_devconfig *it)
return -ENOMEM;
dev->private = devpriv;

dev->board_name = boardtype.name;
dev->board_name = board->name;

s = &dev->subdevices[0];
/* ai subdevice */
Expand All @@ -648,20 +648,20 @@ static int dt2801_attach(struct comedi_device *dev, struct comedi_devconfig *it)
s->n_chan = n_ai_chans;
#else
if (it->options[2])
s->n_chan = boardtype.ad_chan;
s->n_chan = board->ad_chan;
else
s->n_chan = boardtype.ad_chan / 2;
s->n_chan = board->ad_chan / 2;
#endif
s->maxdata = (1 << boardtype.adbits) - 1;
s->range_table = ai_range_lkup(boardtype.adrangetype, it->options[3]);
s->maxdata = (1 << board->adbits) - 1;
s->range_table = ai_range_lkup(board->adrangetype, it->options[3]);
s->insn_read = dt2801_ai_insn_read;

s = &dev->subdevices[1];
/* ao subdevice */
s->type = COMEDI_SUBD_AO;
s->subdev_flags = SDF_WRITABLE;
s->n_chan = 2;
s->maxdata = (1 << boardtype.dabits) - 1;
s->maxdata = (1 << board->dabits) - 1;
s->range_table_list = devpriv->dac_range_types;
devpriv->dac_range_types[0] = dac_range_lkup(it->options[4]);
devpriv->dac_range_types[1] = dac_range_lkup(it->options[5]);
Expand Down

0 comments on commit c3ce27c

Please sign in to comment.