From: Johan Hovold Date: Wed, 4 Nov 2015 17:55:15 +0000 (+0100) Subject: greybus: es1: separate urb allocation and submission X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8dfd3fe56467ceabaac39ea884e0dc882c1832cd;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git greybus: es1: separate urb allocation and submission Separate in-urb allocation and submission. This is needed for the driver-model rework. Compile-tested only. Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/es1.c b/drivers/staging/greybus/es1.c index 23860870d4f1..57247712ce60 100644 --- a/drivers/staging/greybus/es1.c +++ b/drivers/staging/greybus/es1.c @@ -650,7 +650,7 @@ static int ap_probe(struct usb_interface *interface, goto error; } - /* Allocate buffers for our cport in messages and start them up */ + /* Allocate buffers for our cport in messages */ for (i = 0; i < NUM_CPORT_IN_URB; ++i) { struct urb *urb; u8 *buffer; @@ -668,9 +668,6 @@ static int ap_probe(struct usb_interface *interface, cport_in_callback, hd); es1->cport_in_urb[i] = urb; es1->cport_in_buffer[i] = buffer; - retval = usb_submit_urb(urb, GFP_KERNEL); - if (retval) - goto error; } /* Allocate urbs for our CPort OUT messages */ @@ -689,6 +686,13 @@ static int ap_probe(struct usb_interface *interface, (S_IWUSR | S_IRUGO), gb_debugfs_get(), es1, &apb1_log_enable_fops); + + for (i = 0; i < NUM_CPORT_IN_URB; ++i) { + retval = usb_submit_urb(es1->cport_in_urb[i], GFP_KERNEL); + if (retval) + goto error; + } + return 0; error: ap_disconnect(interface);