Staging: comedi: range: tidy up comedi_check_chanlist()
Refactor this function to remove an extra indent level Signed-off-by: Fred Akers <knivey@botops.net> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f3c25d5690
commit
afdc37ee79
|
@ -143,7 +143,10 @@ int comedi_check_chanlist(struct comedi_subdevice *s, int n,
|
|||
unsigned int chanspec;
|
||||
int chan, range_len, i;
|
||||
|
||||
if (s->range_table || s->range_table_list) {
|
||||
if (!s->range_table && !s->range_table_list) {
|
||||
dev_err(dev->class_dev, "(bug) no range type list!\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
for (i = 0; i < n; i++) {
|
||||
chanspec = chanlist[i];
|
||||
chan = CR_CHAN(chanspec);
|
||||
|
@ -162,10 +165,6 @@ int comedi_check_chanlist(struct comedi_subdevice *s, int n,
|
|||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dev_err(dev->class_dev, "(bug) no range type list!\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(comedi_check_chanlist);
|
||||
|
|
Loading…
Reference in New Issue