]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
greybus: set route before sending packets
authorAlex Elder <elder@linaro.org>
Wed, 22 Oct 2014 10:36:17 +0000 (05:36 -0500)
committerGreg Kroah-Hartman <greg@kroah.com>
Wed, 22 Oct 2014 10:46:21 +0000 (18:46 +0800)
The route for a connection needs to be set *before* we initialize
the connection.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/module.c

index bcb0ff0981645aa86a78c297e46121987a64c58b..b1ec0904fb28d4015ab5a2a9b67993f05f564e7e 100644 (file)
@@ -130,13 +130,21 @@ gb_module_interface_init(struct gb_module *gmod, u8 interface_id, u8 device_id)
                        interface_id);
                return -ENOENT;
        }
+
+       ret = svc_set_route_send(interface, gmod->hd);
+       if (ret) {
+               dev_err(gmod->hd->parent, "failed to set route (%d)\n", ret);
+               return ret;
+       }
+
        ret = gb_interface_connections_init(interface);
        if (ret) {
                dev_err(gmod->hd->parent, "module interface init error %d\n",
                        ret);
+               /* XXX clear route */
                return ret;
        }
        interface->device_id = device_id;
 
-       return svc_set_route_send(interface, gmod->hd);
+       return 0;
 }