Commit 71500b27 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: usbdux: tidy up usbdux_free_usb_buffers()

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: 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 4d9861b5
...@@ -1642,15 +1642,15 @@ static int usbdux_alloc_usb_buffers(struct comedi_device *dev) ...@@ -1642,15 +1642,15 @@ static int usbdux_alloc_usb_buffers(struct comedi_device *dev)
return 0; 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; struct urb *urb;
int i; int i;
urb = devpriv->pwm_urb; urb = devpriv->pwm_urb;
if (urb) { if (urb) {
kfree(urb->transfer_buffer); kfree(urb->transfer_buffer);
usb_kill_urb(urb);
usb_free_urb(urb); usb_free_urb(urb);
} }
if (devpriv->ao_urbs) { if (devpriv->ao_urbs) {
...@@ -1658,7 +1658,6 @@ static void usbdux_free_usb_buffers(struct usbdux_private *devpriv) ...@@ -1658,7 +1658,6 @@ static void usbdux_free_usb_buffers(struct usbdux_private *devpriv)
urb = devpriv->ao_urbs[i]; urb = devpriv->ao_urbs[i];
if (urb) { if (urb) {
kfree(urb->transfer_buffer); kfree(urb->transfer_buffer);
usb_kill_urb(urb);
usb_free_urb(urb); usb_free_urb(urb);
} }
} }
...@@ -1669,7 +1668,6 @@ static void usbdux_free_usb_buffers(struct usbdux_private *devpriv) ...@@ -1669,7 +1668,6 @@ static void usbdux_free_usb_buffers(struct usbdux_private *devpriv)
urb = devpriv->ai_urbs[i]; urb = devpriv->ai_urbs[i];
if (urb) { if (urb) {
kfree(urb->transfer_buffer); kfree(urb->transfer_buffer);
usb_kill_urb(urb);
usb_free_urb(urb); usb_free_urb(urb);
} }
} }
...@@ -1811,7 +1809,7 @@ static void usbdux_detach(struct comedi_device *dev) ...@@ -1811,7 +1809,7 @@ static void usbdux_detach(struct comedi_device *dev)
usbdux_ao_stop(dev, 1); usbdux_ao_stop(dev, 1);
usbdux_ai_stop(dev, 1); usbdux_ai_stop(dev, 1);
usbdux_free_usb_buffers(devpriv); usbdux_free_usb_buffers(dev);
up(&devpriv->sem); up(&devpriv->sem);
} }
......
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