Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304559
b: refs/heads/master
c: 2e0031d
h: refs/heads/master
i:
  304557: 4b9ff91
  304555: 20381d6
  304551: eae1d7c
  304543: c008f6f
v: v3
  • Loading branch information
Tomas Melin authored and Greg Kroah-Hartman committed May 9, 2012
1 parent 12ce69c commit 371b87d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 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: 41d8cc1ac2fd5c4695ef0c8239ac0f45e1cd72ca
refs/heads/master: 2e0031dd9078ba980bb664b144355c5ff6d6a030
20 changes: 9 additions & 11 deletions trunk/drivers/staging/comedi/drivers/adv_pci1710.c
Original file line number Diff line number Diff line change
Expand Up @@ -1164,33 +1164,31 @@ static int check_channel_list(struct comedi_device *dev,
if (n_chan == 1)
return 1; /* seglen=1 */

chansegment[0] = chanlist[0]; /* first channel is every time ok */
for (i = 1, seglen = 1; i < n_chan; i++, seglen++) { /* build part of chanlist */
/* printk("%d. %d %d\n",i,CR_CHAN(chanlist[i]),CR_RANGE(chanlist[i])); */
chansegment[0] = chanlist[0]; /* first channel is every time ok */
for (i = 1, seglen = 1; i < n_chan; i++, seglen++) {
if (chanlist[0] == chanlist[i])
break; /* we detect loop, this must by finish */
if (CR_CHAN(chanlist[i]) & 1) /* odd channel cann't by differencial */
break; /* we detected a loop, stop */
if (CR_CHAN(chanlist[i]) & 1)
if (CR_AREF(chanlist[i]) == AREF_DIFF) {
comedi_error(dev,
"Odd channel can't be differential input!\n");
"Odd channel cannot be differential input!\n");
return 0;
}
nowmustbechan =
(CR_CHAN(chansegment[i - 1]) + 1) % s->n_chan;
if (CR_AREF(chansegment[i - 1]) == AREF_DIFF)
nowmustbechan = (nowmustbechan + 1) % s->n_chan;
if (nowmustbechan != CR_CHAN(chanlist[i])) { /* channel list isn't continuous :-( */
if (nowmustbechan != CR_CHAN(chanlist[i])) {
printk
("channel list must be continuous! chanlist[%i]=%d but must be %d or %d!\n",
i, CR_CHAN(chanlist[i]), nowmustbechan,
CR_CHAN(chanlist[0]));
return 0;
}
chansegment[i] = chanlist[i]; /* well, this is next correct channel in list */
chansegment[i] = chanlist[i]; /* next correct channel in list */
}

for (i = 0, segpos = 0; i < n_chan; i++) { /* check whole chanlist */
/* printk("%d %d=%d %d\n",CR_CHAN(chansegment[i%seglen]),CR_RANGE(chansegment[i%seglen]),CR_CHAN(chanlist[i]),CR_RANGE(chanlist[i])); */
for (i = 0, segpos = 0; i < n_chan; i++) {
if (chanlist[i] != chansegment[i % seglen]) {
printk
("bad channel, reference or range number! chanlist[%i]=%d,%d,%d and not %d,%d,%d!\n",
Expand All @@ -1200,7 +1198,7 @@ static int check_channel_list(struct comedi_device *dev,
CR_CHAN(chanlist[i % seglen]),
CR_RANGE(chanlist[i % seglen]),
CR_AREF(chansegment[i % seglen]));
return 0; /* chan/gain list is strange */
return 0; /* chan/gain list is strange */
}
}
return seglen;
Expand Down

0 comments on commit 371b87d

Please sign in to comment.