From: H Hartley Sweeten Date: Tue, 14 May 2013 20:38:48 +0000 (-0700) Subject: staging: comedi: usbduxfast: tidy up usbduxfast_ai_cancel() X-Git-Tag: firefly_0821_release~176^2~5845^2~644 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ce976fdb247dc05901c59f9e36c9104293a23119;p=firefly-linux-kernel-4.4.55.git staging: comedi: usbduxfast: tidy up usbduxfast_ai_cancel() Remove the unnecessary comments and dev_err() noise. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/usbduxfast.c b/drivers/staging/comedi/drivers/usbduxfast.c index dd4f177a9840..9120df79d703 100644 --- a/drivers/staging/comedi/drivers/usbduxfast.c +++ b/drivers/staging/comedi/drivers/usbduxfast.c @@ -200,23 +200,16 @@ static int usbduxfast_ai_stop(struct comedi_device *dev, int do_unlink) return 0; } -/* - * This will cancel a running acquisition operation. - * This is called by comedi but never from inside the driver. - */ static int usbduxfast_ai_cancel(struct comedi_device *dev, struct comedi_subdevice *s) { struct usbduxfast_private *devpriv = dev->private; int ret; - /* force unlink of all urbs */ - if (!devpriv) { - dev_err(dev->class_dev, "%s: devpriv=NULL\n", __func__); + if (!devpriv) return -EFAULT; - } + down(&devpriv->sem); - /* unlink */ ret = usbduxfast_ai_stop(dev, 1); up(&devpriv->sem);