staging: comedi: usbdux: use the stop helpers in the detach
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Thu, 25 Jul 2013 23:08:16 +0000 (16:08 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Jul 2013 22:10:07 +0000 (15:10 -0700)
Use the stop helpers instead of duplicating the code in the detach.

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>
drivers/staging/comedi/drivers/usbdux.c

index 7077d268f883571af983fa100cc845e92944758b..f60674344ea84af888f2959b7da4b7aa9b62ad99 100644 (file)
@@ -1941,12 +1941,10 @@ static void usbdux_detach(struct comedi_device *dev)
 
                usb_set_intfdata(intf, NULL);
 
-               if (devpriv->pwm_cmd_running)
-                       usbduxsub_unlink_pwm_urbs(dev);
-               if (devpriv->ao_cmd_running)
-                       usbduxsub_unlink_outurbs(dev);
-               if (devpriv->ai_cmd_running)
-                       usbduxsub_unlink_inurbs(dev);
+               /* stop and unlink any submitted urbs */
+               usbdux_pwm_stop(dev, devpriv->pwm_cmd_running);
+               usbdux_ao_stop(dev, devpriv->ao_cmd_running);
+               usbdux_ai_stop(dev, devpriv->ai_cmd_running);
 
                usbdux_free_usb_buffers(devpriv);