From ecc2b22990bd59b2e8ea34afa0334598cbdfad71 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Thu, 25 Jul 2013 16:08:16 -0700 Subject: [PATCH] staging: comedi: usbdux: use the stop helpers in the detach Use the stop helpers instead of duplicating the code in the detach. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/usbdux.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/staging/comedi/drivers/usbdux.c b/drivers/staging/comedi/drivers/usbdux.c index 7077d268f883..f60674344ea8 100644 --- a/drivers/staging/comedi/drivers/usbdux.c +++ b/drivers/staging/comedi/drivers/usbdux.c @@ -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); -- 2.39.5