Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 317103
b: refs/heads/master
c: b13ff04
h: refs/heads/master
i:
  317101: 6734b09
  317099: a6194ed
  317095: cc1d83e
  317087: 9c23e7a
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jun 5, 2012
1 parent f8f9f48 commit 329dd5c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 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: 797ef32ba35589393f993bb2f18698d4bc3ad07d
refs/heads/master: b13ff04654b406618f96e59168006c530f4774aa
19 changes: 7 additions & 12 deletions trunk/drivers/staging/comedi/drivers/adq12b.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ struct adq12b_board {
int do_chans;
};

#define thisboard ((const struct adq12b_board *)dev->board_ptr)

struct adq12b_private {
int unipolar; /* option 2 of comedi_config (1 is iobase) */
int differential; /* option 3 of comedi_config */
Expand Down Expand Up @@ -222,6 +220,7 @@ static int adq12b_do_insn_bits(struct comedi_device *dev,

static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it)
{
const struct adq12b_board *board = comedi_board(dev);
struct comedi_subdevice *s;
unsigned long iobase;
int unipolar, differential;
Expand Down Expand Up @@ -250,11 +249,7 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it)
}
dev->iobase = iobase;

/*
* 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 Down Expand Up @@ -284,18 +279,18 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it)
s->type = COMEDI_SUBD_AI;
if (differential) {
s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_DIFF;
s->n_chan = thisboard->ai_diff_chans;
s->n_chan = board->ai_diff_chans;
} else {
s->subdev_flags = SDF_READABLE | SDF_GROUND;
s->n_chan = thisboard->ai_se_chans;
s->n_chan = board->ai_se_chans;
}

if (unipolar)
s->range_table = &range_adq12b_ai_unipolar;
else
s->range_table = &range_adq12b_ai_bipolar;

s->maxdata = (1 << thisboard->ai_bits) - 1;
s->maxdata = (1 << board->ai_bits) - 1;

s->len_chanlist = 4; /* This is the maximum chanlist length that
the board can handle */
Expand All @@ -305,7 +300,7 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it)
/* digital input subdevice */
s->type = COMEDI_SUBD_DI;
s->subdev_flags = SDF_READABLE;
s->n_chan = thisboard->di_chans;
s->n_chan = board->di_chans;
s->maxdata = 1;
s->range_table = &range_digital;
s->insn_bits = adq12b_di_insn_bits;
Expand All @@ -314,7 +309,7 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it)
/* digital output subdevice */
s->type = COMEDI_SUBD_DO;
s->subdev_flags = SDF_WRITABLE;
s->n_chan = thisboard->do_chans;
s->n_chan = board->do_chans;
s->maxdata = 1;
s->range_table = &range_digital;
s->insn_bits = adq12b_do_insn_bits;
Expand Down

0 comments on commit 329dd5c

Please sign in to comment.