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

staging: comedi: usbduxsigma: use usbdux_ao_stop() to force unlink all urbs

In tidy_up(), instead of duplicating the code in usbdux_ao_stop() to unlink
all the output urbs, just use usbdux_ao_stop(). Since that function calls
usb_kill_urb() for all the urbs and clears the 'ao_cmd_running' flag, we
can also remove the redundant code in tidy_up().
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 705a8f72
...@@ -1920,10 +1920,8 @@ static void tidy_up(struct usbduxsub *usbduxsub_tmp) ...@@ -1920,10 +1920,8 @@ static void tidy_up(struct usbduxsub *usbduxsub_tmp)
usbduxsub_tmp->urbIn = NULL; usbduxsub_tmp->urbIn = NULL;
} }
if (usbduxsub_tmp->urbOut) { if (usbduxsub_tmp->urbOut) {
if (usbduxsub_tmp->ao_cmd_running) { /* force unlink all urbs */
usbduxsub_tmp->ao_cmd_running = 0; usbdux_ao_stop(usbduxsub_tmp, 1);
usbduxsub_unlink_OutURBs(usbduxsub_tmp);
}
for (i = 0; i < usbduxsub_tmp->numOfOutBuffers; i++) { for (i = 0; i < usbduxsub_tmp->numOfOutBuffers; i++) {
if (usbduxsub_tmp->urbOut[i]->transfer_buffer) { if (usbduxsub_tmp->urbOut[i]->transfer_buffer) {
kfree(usbduxsub_tmp-> kfree(usbduxsub_tmp->
...@@ -1932,7 +1930,6 @@ static void tidy_up(struct usbduxsub *usbduxsub_tmp) ...@@ -1932,7 +1930,6 @@ static void tidy_up(struct usbduxsub *usbduxsub_tmp)
NULL; NULL;
} }
if (usbduxsub_tmp->urbOut[i]) { if (usbduxsub_tmp->urbOut[i]) {
usb_kill_urb(usbduxsub_tmp->urbOut[i]);
usb_free_urb(usbduxsub_tmp->urbOut[i]); usb_free_urb(usbduxsub_tmp->urbOut[i]);
usbduxsub_tmp->urbOut[i] = NULL; usbduxsub_tmp->urbOut[i] = NULL;
} }
...@@ -1961,7 +1958,6 @@ static void tidy_up(struct usbduxsub *usbduxsub_tmp) ...@@ -1961,7 +1958,6 @@ static void tidy_up(struct usbduxsub *usbduxsub_tmp)
usbduxsub_tmp->dac_commands = NULL; usbduxsub_tmp->dac_commands = NULL;
kfree(usbduxsub_tmp->dux_commands); kfree(usbduxsub_tmp->dux_commands);
usbduxsub_tmp->dux_commands = NULL; usbduxsub_tmp->dux_commands = NULL;
usbduxsub_tmp->ao_cmd_running = 0;
usbduxsub_tmp->pwm_cmd_running = 0; usbduxsub_tmp->pwm_cmd_running = 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