For aesthetics, pass the comedi_device pointer to this function
instead of the private data pointer.
The usb_kill_urb() calls are not needed. All the urbs were unlinked
before this function was called.
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>
return 0;
}
-static void usbdux_free_usb_buffers(struct usbdux_private *devpriv)
+static void usbdux_free_usb_buffers(struct comedi_device *dev)
{
+ struct usbdux_private *devpriv = dev->private;
struct urb *urb;
int i;
urb = devpriv->pwm_urb;
if (urb) {
kfree(urb->transfer_buffer);
- usb_kill_urb(urb);
usb_free_urb(urb);
}
if (devpriv->ao_urbs) {
urb = devpriv->ao_urbs[i];
if (urb) {
kfree(urb->transfer_buffer);
- usb_kill_urb(urb);
usb_free_urb(urb);
}
}
urb = devpriv->ai_urbs[i];
if (urb) {
kfree(urb->transfer_buffer);
- usb_kill_urb(urb);
usb_free_urb(urb);
}
}
usbdux_ao_stop(dev, 1);
usbdux_ai_stop(dev, 1);
- usbdux_free_usb_buffers(devpriv);
+ usbdux_free_usb_buffers(dev);
up(&devpriv->sem);
}