[PATCH 49/53] staging: comedi: usbdux: use the stop helpers in the detach

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use the stop helpers instead of duplicating the code in the detach.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxx>
---
 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 23be4ab..8d9b32f 100644
--- a/drivers/staging/comedi/drivers/usbdux.c
+++ b/drivers/staging/comedi/drivers/usbdux.c
@@ -1934,12 +1934,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);
 
-- 
1.8.3.2

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux