]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
greybus: endo: pass endo_id to gb_endo_create()
authorAlex Elder <elder@linaro.org>
Fri, 22 May 2015 14:52:43 +0000 (09:52 -0500)
committerGreg Kroah-Hartman <gregkh@google.com>
Sat, 23 May 2015 23:31:42 +0000 (16:31 -0700)
We are going to want to defer creating the endo until we receive a
probe operation from the SVC, which will supply the endo id.  Change
gb_endo_create() so it passes the endo_id value as an argument.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/core.c
drivers/staging/greybus/endo.c
drivers/staging/greybus/endo.h

index e32d6c41e87e87cd17991fa03b97175238aae145..27062e7a5824fd9fcca032bffda084878b7a9ef7 100644 (file)
@@ -177,6 +177,7 @@ struct greybus_host_device *greybus_create_hd(struct greybus_host_driver *driver
                                              size_t buffer_size_max)
 {
        struct greybus_host_device *hd;
+       u16 endo_id = 0x4755; // FIXME - get endo "ID" from the SVC
 
        /*
         * Validate that the driver implements all of the callbacks
@@ -210,7 +211,7 @@ struct greybus_host_device *greybus_create_hd(struct greybus_host_driver *driver
        ida_init(&hd->cport_id_map);
        hd->buffer_size_max = buffer_size_max;
 
-       hd->endo = gb_endo_create(hd);
+       hd->endo = gb_endo_create(hd, endo_id);
        if (!hd->endo) {
                greybus_remove_hd(hd);
                return NULL;
index 859c9c57989d483aa3f13acea6dfcf0072432e06..fb2f7c9c6dd7b73098f4b0bf73858a6a77f1d55d 100644 (file)
@@ -423,11 +423,10 @@ static int gb_endo_register(struct greybus_host_device *hd,
        return retval;
 }
 
-struct gb_endo *gb_endo_create(struct greybus_host_device *hd)
+struct gb_endo *gb_endo_create(struct greybus_host_device *hd, u16 endo_id)
 {
        struct gb_endo *endo;
        int retval;
-       u16 endo_id = 0x4755; // FIXME - get endo "ID" from the SVC
 
        endo = kzalloc(sizeof(*endo), GFP_KERNEL);
        if (!endo)
index 2920b130ce37fdaaf9f28cd7fa9ecdb20d7bbe52..c1ccbcd576f3a3bea29a3c5545c6ab621c8f3438 100644 (file)
@@ -47,7 +47,7 @@ struct gb_endo {
 /* Greybus "private" definitions */
 struct greybus_host_device;
 
-struct gb_endo *gb_endo_create(struct greybus_host_device *hd);
+struct gb_endo *gb_endo_create(struct greybus_host_device *hd, u16 endo_id);
 void gb_endo_remove(struct gb_endo *endo);
 
 u8 endo_get_module_id(struct gb_endo *endo, u8 interface_id);