Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 324930
b: refs/heads/master
c: 5818e70
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Sep 6, 2012
1 parent 4f60b95 commit 2cf5b57
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 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: d3d1e2532f33b49515bf9ea9e2b4cc1dbb1d47c9
refs/heads/master: 5818e7090bb6eacb886bd2f7fc3df06e23047b29
9 changes: 6 additions & 3 deletions trunk/drivers/staging/comedi/kcomedilib/kcomedilib_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ static int comedi_do_insn(struct comedi_device *dev, struct comedi_insn *insn)
ret = -EINVAL;
goto error;
}
s = dev->subdevices + insn->subdev;
s = &dev->subdevices[insn->subdev];

if (s->type == COMEDI_SUBD_UNUSED) {
printk(KERN_ERR "%d not useable subdevice\n", insn->subdev);
Expand Down Expand Up @@ -175,11 +175,14 @@ EXPORT_SYMBOL(comedi_dio_bitfield);
int comedi_find_subdevice_by_type(struct comedi_device *dev, int type,
unsigned int subd)
{
struct comedi_subdevice *s;

if (subd > dev->n_subdevices)
return -ENODEV;

for (; subd < dev->n_subdevices; subd++) {
if (dev->subdevices[subd].type == type)
s = &dev->subdevices[subd];
if (s->type == type)
return subd;
}
return -1;
Expand All @@ -188,7 +191,7 @@ EXPORT_SYMBOL(comedi_find_subdevice_by_type);

int comedi_get_n_channels(struct comedi_device *dev, unsigned int subdevice)
{
struct comedi_subdevice *s = dev->subdevices + subdevice;
struct comedi_subdevice *s = &dev->subdevices[subdevice];

return s->n_chan;
}
Expand Down

0 comments on commit 2cf5b57

Please sign in to comment.