Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 317637
b: refs/heads/master
c: f3c34b2
h: refs/heads/master
i:
  317635: 82b3fcd
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jul 6, 2012
1 parent 67a8587 commit 068fca3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 21 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: 8f608fc8eefc9bff17a7139801eb4b4f571f262d
refs/heads/master: f3c34b2fc6ccc36f171633fa86b3d59a36792c25
30 changes: 10 additions & 20 deletions trunk/drivers/staging/comedi/drivers/cb_pcidas.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,38 +439,28 @@ static int cb_pcidas_ai_rinsn(struct comedi_device *dev,
return n;
}

static int ai_config_calibration_source(struct comedi_device *dev,
unsigned int *data)
{
struct cb_pcidas_private *devpriv = dev->private;
static const int num_calibration_sources = 8;
unsigned int source = data[1];

if (source >= num_calibration_sources) {
dev_err(dev->class_dev, "invalid calibration source: %i\n",
source);
return -EINVAL;
}

devpriv->calibration_source = source;

return 2;
}

static int ai_config_insn(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
struct cb_pcidas_private *devpriv = dev->private;
int id = data[0];
unsigned int source = data[1];

switch (id) {
case INSN_CONFIG_ALT_SOURCE:
return ai_config_calibration_source(dev, data);
if (source >= 8) {
dev_err(dev->class_dev,
"invalid calibration source: %i\n",
source);
return -EINVAL;
}
devpriv->calibration_source = source;
break;
default:
return -EINVAL;
break;
}
return -EINVAL;
return insn->n;
}

/* analog output insn for pcidas-1000 and 1200 series */
Expand Down

0 comments on commit 068fca3

Please sign in to comment.