staging: comedi: usbdux: tidy up usbdux_ai_cancel()
Rename the local variable used for the private data pointer to the comedi "norm". Remove the unnecessary sanity check of the private data pointer. This function can only be called is the private data was allocated during the attach. 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>
This commit is contained in:
parent
b3476e67c1
commit
aa6081e5e0
@ -283,27 +283,19 @@ static int usbdux_ai_stop(struct comedi_device *dev, int do_unlink)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* This will cancel a running acquisition operation.
|
|
||||||
* This is called by comedi but never from inside the driver.
|
|
||||||
*/
|
|
||||||
static int usbdux_ai_cancel(struct comedi_device *dev,
|
static int usbdux_ai_cancel(struct comedi_device *dev,
|
||||||
struct comedi_subdevice *s)
|
struct comedi_subdevice *s)
|
||||||
{
|
{
|
||||||
struct usbdux_private *this_usbduxsub;
|
struct usbdux_private *devpriv = dev->private;
|
||||||
int res = 0;
|
int ret = 0;
|
||||||
|
|
||||||
/* force unlink of all urbs */
|
|
||||||
this_usbduxsub = dev->private;
|
|
||||||
if (!this_usbduxsub)
|
|
||||||
return -EFAULT;
|
|
||||||
|
|
||||||
/* prevent other CPUs from submitting new commands just now */
|
/* prevent other CPUs from submitting new commands just now */
|
||||||
down(&this_usbduxsub->sem);
|
down(&devpriv->sem);
|
||||||
/* unlink only if the urb really has been submitted */
|
/* unlink only if the urb really has been submitted */
|
||||||
res = usbdux_ai_stop(dev, this_usbduxsub->ai_cmd_running);
|
ret = usbdux_ai_stop(dev, devpriv->ai_cmd_running);
|
||||||
up(&this_usbduxsub->sem);
|
up(&devpriv->sem);
|
||||||
return res;
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* analogue IN - interrupt service routine */
|
/* analogue IN - interrupt service routine */
|
||||||
|
Loading…
Reference in New Issue
Block a user