greybus: es1: create svc connection early enough
authorViresh Kumar <viresh.kumar@linaro.org>
Sat, 25 Jul 2015 04:40:05 +0000 (10:10 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Mon, 27 Jul 2015 21:13:20 +0000 (14:13 -0700)
The svc connection needs to be ready before creating the URBs, otherwise
the svc version request might come in before the AP was ready to parse
them.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/es1.c
drivers/staging/greybus/es2.c

index e203180e1e5c8c5cd2dbd1e4a438f8e4ae555be4..5418f4675ec13587d16929151efbc8c8a104c82e 100644 (file)
@@ -563,6 +563,12 @@ static int ap_probe(struct usb_interface *interface,
                return PTR_ERR(hd);
        }
 
+       /* Initialize AP's greybus interface */
+       if (!gb_ap_svc_connection_create(hd)) {
+               retval = -EINVAL;
+               goto error;
+       }
+
        es1 = hd_to_es1(hd);
        es1->hd = hd;
        es1->usb_intf = interface;
@@ -632,12 +638,6 @@ static int ap_probe(struct usb_interface *interface,
                es1->cport_out_urb_busy[i] = false;     /* just to be anal */
        }
 
-       /* Initialize AP's greybus interface */
-       if (!gb_ap_svc_connection_create(hd)) {
-               retval = -EINVAL;
-               goto error;
-       }
-
        apb1_log_enable_dentry = debugfs_create_file("apb1_log_enable",
                                                        (S_IWUSR | S_IRUGO),
                                                        gb_debugfs_get(), es1,
index aba1927fc34f0b0f0a879d3f26bb5359f17bf25f..d2c054a2ec0e89feab3dbc607746d0d59e5c28a6 100644 (file)
@@ -663,6 +663,12 @@ static int ap_probe(struct usb_interface *interface,
                return PTR_ERR(hd);
        }
 
+       /* Initialize AP's greybus interface */
+       if (!gb_ap_svc_connection_create(hd)) {
+               retval = -EINVAL;
+               goto error;
+       }
+
        es1 = hd_to_es1(hd);
        es1->hd = hd;
        es1->usb_intf = interface;
@@ -736,12 +742,6 @@ static int ap_probe(struct usb_interface *interface,
                es1->cport_out_urb_busy[i] = false;     /* just to be anal */
        }
 
-       /* Initialize AP's greybus interface */
-       if (!gb_ap_svc_connection_create(hd)) {
-               retval = -EINVAL;
-               goto error;
-       }
-
        apb1_log_enable_dentry = debugfs_create_file("apb1_log_enable",
                                                        (S_IWUSR | S_IRUGO),
                                                        gb_debugfs_get(), es1,