Skip to content

Commit

Permalink
staging: comedi: gsc_hpdi: cleanup step 3 of me4000_ai_do_cmd_test()
Browse files Browse the repository at this point in the history
Remove the dev_err() noise and convert the error handling to the
normal form (err |= -EINVAL) used in the do_cmdtest functions.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Nov 15, 2012
1 parent bf1b202 commit 8c6c5a6
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions drivers/staging/comedi/drivers/me4000.c
Original file line number Diff line number Diff line change
Expand Up @@ -969,28 +969,23 @@ static int me4000_ai_do_cmd_test(struct comedi_device *dev,
if (err)
return 2;

/*
* Stage 3. Check if arguments are generally valid.
*/
/* Step 3: check if arguments are trivially valid */

if (cmd->chanlist_len < 1) {
dev_err(dev->class_dev, "No channel list\n");
cmd->chanlist_len = 1;
err++;
err |= -EINVAL;
}
if (init_ticks < 66) {
dev_err(dev->class_dev, "Start arg to low\n");
cmd->start_arg = 2000;
err++;
err |= -EINVAL;
}
if (scan_ticks && scan_ticks < 67) {
dev_err(dev->class_dev, "Scan begin arg to low\n");
cmd->scan_begin_arg = 2031;
err++;
err |= -EINVAL;
}
if (chan_ticks < 66) {
dev_err(dev->class_dev, "Convert arg to low\n");
cmd->convert_arg = 2000;
err++;
err |= -EINVAL;
}

if (err)
Expand Down

0 comments on commit 8c6c5a6

Please sign in to comment.