Commit 61b3980f authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: pcl816: reduce indent level in pcl816_ai_cancel()

If an async command is not running the (*cancel) function doesn't do
anything. Exit the function early if this is the case.

This allows reducing the indent level in the rest of the function.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a8f461c2
......@@ -549,7 +549,9 @@ static int pcl816_ai_cancel(struct comedi_device *dev,
{
struct pcl816_private *devpriv = dev->private;
if (devpriv->ai_cmd_running) {
if (!devpriv->ai_cmd_running)
return 0;
switch (devpriv->int816_mode) {
case INT_TYPE_AI1_DMA:
case INT_TYPE_AI3_DMA:
......@@ -576,10 +578,9 @@ static int pcl816_ai_cancel(struct comedi_device *dev,
devpriv->ai_cmd_running = 0;
devpriv->irq_was_now_closed = 1;
devpriv->int816_mode = 0;
/* s->busy = 0; */
break;
}
}
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment