From: H Hartley Sweeten Date: Thu, 23 May 2013 19:43:35 +0000 (-0700) Subject: staging: comedi: usbduxsigma: use usbdux_ao_stop() to force unlink all urbs X-Git-Tag: next-20130607~22^2~267 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=dc29c6fa5e5b3f18b29a4c552ea4f67376ebf2cd;p=karo-tx-linux.git 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: H Hartley Sweeten Cc: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/usbduxsigma.c b/drivers/staging/comedi/drivers/usbduxsigma.c index 4d941408cd75..5f7e19d9ec88 100644 --- a/drivers/staging/comedi/drivers/usbduxsigma.c +++ b/drivers/staging/comedi/drivers/usbduxsigma.c @@ -1920,10 +1920,8 @@ static void tidy_up(struct usbduxsub *usbduxsub_tmp) usbduxsub_tmp->urbIn = NULL; } if (usbduxsub_tmp->urbOut) { - if (usbduxsub_tmp->ao_cmd_running) { - usbduxsub_tmp->ao_cmd_running = 0; - usbduxsub_unlink_OutURBs(usbduxsub_tmp); - } + /* force unlink all urbs */ + usbdux_ao_stop(usbduxsub_tmp, 1); for (i = 0; i < usbduxsub_tmp->numOfOutBuffers; i++) { if (usbduxsub_tmp->urbOut[i]->transfer_buffer) { kfree(usbduxsub_tmp-> @@ -1932,7 +1930,6 @@ static void tidy_up(struct usbduxsub *usbduxsub_tmp) NULL; } if (usbduxsub_tmp->urbOut[i]) { - usb_kill_urb(usbduxsub_tmp->urbOut[i]); usb_free_urb(usbduxsub_tmp->urbOut[i]); usbduxsub_tmp->urbOut[i] = NULL; } @@ -1961,7 +1958,6 @@ static void tidy_up(struct usbduxsub *usbduxsub_tmp) usbduxsub_tmp->dac_commands = NULL; kfree(usbduxsub_tmp->dux_commands); usbduxsub_tmp->dux_commands = NULL; - usbduxsub_tmp->ao_cmd_running = 0; usbduxsub_tmp->pwm_cmd_running = 0; }