staging: comedi: me4000: absorb ai_prepare()
This function never fails and it's only called by me4000_ai_do_cmd(). Absorb it and remove the unnecessary failure check. Signed-off-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
272e426ebc
commit
11e480c3a6
|
@ -681,12 +681,18 @@ static int me4000_ai_write_chanlist(struct comedi_device *dev,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ai_prepare(struct comedi_device *dev,
|
static int me4000_ai_do_cmd(struct comedi_device *dev,
|
||||||
struct comedi_subdevice *s,
|
struct comedi_subdevice *s)
|
||||||
struct comedi_cmd *cmd)
|
|
||||||
{
|
{
|
||||||
struct me4000_private *devpriv = dev->private;
|
struct me4000_private *devpriv = dev->private;
|
||||||
|
struct comedi_cmd *cmd = &s->async->cmd;
|
||||||
unsigned int ctrl;
|
unsigned int ctrl;
|
||||||
|
int err;
|
||||||
|
|
||||||
|
/* Reset the analog input */
|
||||||
|
err = me4000_ai_cancel(dev, s);
|
||||||
|
if (err)
|
||||||
|
return err;
|
||||||
|
|
||||||
/* Write timer arguments */
|
/* Write timer arguments */
|
||||||
ai_write_timer(dev);
|
ai_write_timer(dev);
|
||||||
|
@ -718,25 +724,6 @@ static int ai_prepare(struct comedi_device *dev,
|
||||||
/* Write the channel list */
|
/* Write the channel list */
|
||||||
me4000_ai_write_chanlist(dev, s, cmd);
|
me4000_ai_write_chanlist(dev, s, cmd);
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int me4000_ai_do_cmd(struct comedi_device *dev,
|
|
||||||
struct comedi_subdevice *s)
|
|
||||||
{
|
|
||||||
int err;
|
|
||||||
struct comedi_cmd *cmd = &s->async->cmd;
|
|
||||||
|
|
||||||
/* Reset the analog input */
|
|
||||||
err = me4000_ai_cancel(dev, s);
|
|
||||||
if (err)
|
|
||||||
return err;
|
|
||||||
|
|
||||||
/* Prepare the AI for acquisition */
|
|
||||||
err = ai_prepare(dev, s, cmd);
|
|
||||||
if (err)
|
|
||||||
return err;
|
|
||||||
|
|
||||||
/* Start acquistion by dummy read */
|
/* Start acquistion by dummy read */
|
||||||
inl(dev->iobase + ME4000_AI_START_REG);
|
inl(dev->iobase + ME4000_AI_START_REG);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue