return 0;
}
-static int ai_round_cmd_args(struct comedi_device *dev,
- struct comedi_subdevice *s,
- struct comedi_cmd *cmd,
- unsigned int *init_ticks,
- unsigned int *scan_ticks, unsigned int *chan_ticks)
+static void me4000_ai_round_cmd_args(struct comedi_device *dev,
+ struct comedi_subdevice *s,
+ struct comedi_cmd *cmd,
+ unsigned int *init_ticks,
+ unsigned int *scan_ticks,
+ unsigned int *chan_ticks)
{
int rest;
(*chan_ticks)++;
}
}
-
- return 0;
}
static void ai_write_timer(struct comedi_device *dev,
return err;
/* Round the timer arguments */
- err = ai_round_cmd_args(dev,
- s, cmd, &init_ticks, &scan_ticks, &chan_ticks);
- if (err)
- return err;
+ me4000_ai_round_cmd_args(dev, s, cmd,
+ &init_ticks, &scan_ticks, &chan_ticks);
/* Prepare the AI for acquisition */
err = ai_prepare(dev, s, cmd, init_ticks, scan_ticks, chan_ticks);
unsigned int scan_ticks;
int err = 0;
- /* Round the timer arguments */
- ai_round_cmd_args(dev, s, cmd, &init_ticks, &scan_ticks, &chan_ticks);
-
/* Step 1 : check if triggers are trivially valid */
err |= comedi_check_trigger_src(&cmd->start_src, TRIG_NOW | TRIG_EXT);
cmd->chanlist_len = 1;
err |= -EINVAL;
}
+
+ /* Round the timer arguments */
+ me4000_ai_round_cmd_args(dev, s, cmd,
+ &init_ticks, &scan_ticks, &chan_ticks);
+
if (init_ticks < 66) {
cmd->start_arg = 2000;
err |= -EINVAL;