From 715d7a7280697540f9b6a4d82c3c9d1fa208c48d Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Wed, 4 Nov 2015 18:55:17 +0100 Subject: [PATCH] greybus: es1: separate stopping and deallocating urbs Separate stopping and deallocating our in-urbs. This will facilitate implementing proper host-device life-time management. Compile-only tested. Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/es1.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/greybus/es1.c b/drivers/staging/greybus/es1.c index 5724771..ddca5f9 100644 --- a/drivers/staging/greybus/es1.c +++ b/drivers/staging/greybus/es1.c @@ -369,6 +369,9 @@ static void ap_disconnect(struct usb_interface *interface) if (!es1) return; + for (i = 0; i < NUM_CPORT_IN_URB; ++i) + usb_kill_urb(es1->cport_in_urb[i]); + usb_log_disable(es1); /* Tear down everything! */ @@ -377,7 +380,6 @@ static void ap_disconnect(struct usb_interface *interface) if (!urb) break; - usb_kill_urb(urb); usb_free_urb(urb); es1->cport_out_urb[i] = NULL; es1->cport_out_urb_busy[i] = false; /* just to be anal */ -- 2.7.4