Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 363949
b: refs/heads/master
c: fef2aa6
h: refs/heads/master
i:
  363947: f5f8d57
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Apr 8, 2013
1 parent 9ec512c commit 578e335
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 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: 9876d566f2083ddec61331d3988eaec76f5ef8f8
refs/heads/master: fef2aa646fa4293e3dbbdd40158c8e318f936916
12 changes: 7 additions & 5 deletions trunk/drivers/staging/comedi/drivers/das1800.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,6 @@ static const struct das1800_board das1800_boards[] = {
},
};

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

struct das1800_private {
volatile unsigned int count; /* number of data points left to be taken */
unsigned int divisor1; /* value to load into board's counter 1 for timed conversions */
Expand Down Expand Up @@ -468,6 +463,8 @@ 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 = comedi_board(dev);

sample += 1 << (thisboard->resolution - 1);
return sample;
}
Expand Down Expand Up @@ -781,6 +778,7 @@ static int das1800_ai_do_cmdtest(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_cmd *cmd)
{
const struct das1800_board *thisboard = comedi_board(dev);
struct das1800_private *devpriv = dev->private;
int err = 0;
unsigned int tmp_arg;
Expand Down Expand Up @@ -1224,6 +1222,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 = comedi_board(dev);
int i, n;
int chan, range, aref, chan_range;
int timeout = 1000;
Expand Down Expand Up @@ -1287,6 +1286,7 @@ 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 = comedi_board(dev);
struct das1800_private *devpriv = dev->private;
int chan = CR_CHAN(insn->chanspec);
/* int range = CR_RANGE(insn->chanspec); */
Expand Down Expand Up @@ -1508,6 +1508,7 @@ static int das1800_probe(struct comedi_device *dev)
static int das1800_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
const struct das1800_board *thisboard = comedi_board(dev);
struct das1800_private *devpriv;
struct comedi_subdevice *s;
unsigned long iobase = it->options[0];
Expand Down Expand Up @@ -1556,6 +1557,7 @@ static int das1800_attach(struct comedi_device *dev,
}

dev->board_ptr = das1800_boards + board;
thisboard = comedi_board(dev);
dev->board_name = thisboard->name;

/* if it is an 'ao' board with fancy analog out then we need extra io ports */
Expand Down

0 comments on commit 578e335

Please sign in to comment.