summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/es1.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <greg@kroah.com>2015-01-22 21:19:25 +0800
committerGreg Kroah-Hartman <greg@kroah.com>2015-01-23 22:55:57 +0800
commit45a706368d9b162dde2455c305158131af37131d (patch)
treec96db19c10ad0188a25c013fde34051ab5b596e8 /drivers/staging/greybus/es1.c
parente0b179ee782d80b31ccfe8cbcb1505cb703dfdbc (diff)
greybus: es1.c: wait until the last possible minute to start the svc messages
When initializing the USB device, we were starting up the svc message queue before the cport urbs were allocated. This might not be an issue for "slower" machines, but not having any allocated urbs for a cport might be an issue if we were to handle svc messages. So wait until everything is properly initialized and allocated before starting the svc urb. Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Diffstat (limited to 'drivers/staging/greybus/es1.c')
-rw-r--r--drivers/staging/greybus/es1.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/staging/greybus/es1.c b/drivers/staging/greybus/es1.c
index 2ec5d7b403a3..bbf1bd1048be 100644
--- a/drivers/staging/greybus/es1.c
+++ b/drivers/staging/greybus/es1.c
@@ -559,9 +559,6 @@ static int ap_probe(struct usb_interface *interface,
usb_rcvintpipe(udev, es1->svc_endpoint),
es1->svc_buffer, ES1_SVC_MSG_SIZE, svc_in_callback,
hd, svc_interval);
- retval = usb_submit_urb(es1->svc_urb, GFP_KERNEL);
- if (retval)
- goto error;
/* Allocate buffers for our cport in messages and start them up */
for (i = 0; i < NUM_CPORT_IN_URB; ++i) {
@@ -598,6 +595,11 @@ static int ap_probe(struct usb_interface *interface,
es1->cport_out_urb_busy[i] = false; /* just to be anal */
}
+ /* Start up our svc urb, which allows events to start flowing */
+ retval = usb_submit_urb(es1->svc_urb, GFP_KERNEL);
+ if (retval)
+ goto error;
+
return 0;
error:
ap_disconnect(interface);