summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/module.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2015-05-08 12:58:51 +0530
committerGreg Kroah-Hartman <gregkh@google.com>2015-05-11 13:30:09 -0700
commit51e93aea65cdab93ae013b87a7e6b3a9eccef5ad (patch)
treecfdab236efb1f8e44d2438f96081ea9c7b5e7bc0 /drivers/staging/greybus/module.c
parent4f4cc1bf070e05d4ee54e569e7ec87168fa8e284 (diff)
downloadlinux-51e93aea65cdab93ae013b87a7e6b3a9eccef5ad.tar.gz
linux-51e93aea65cdab93ae013b87a7e6b3a9eccef5ad.tar.bz2
linux-51e93aea65cdab93ae013b87a7e6b3a9eccef5ad.zip
greybus: endo: Create modules after validating Endo ID
We already have code to parse Endo ID, lets use it to create modules at run time instead of creating them from a static array. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/module.c')
-rw-r--r--drivers/staging/greybus/module.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/staging/greybus/module.c b/drivers/staging/greybus/module.c
index 202f141c7fe3..8ed96a8ba26d 100644
--- a/drivers/staging/greybus/module.c
+++ b/drivers/staging/greybus/module.c
@@ -83,17 +83,6 @@ struct device_type greybus_module_type = {
.release = greybus_module_release,
};
-u8 get_module_id(u8 interface_id)
-{
- /*
- * FIXME:
- *
- * We should be able to find it from Endo ID passed during greybus
- * control operation, while setting up AP.
- */
- return interface_id;
-}
-
struct module_find {
struct gb_endo *endo;
u8 module_id;
@@ -125,6 +114,9 @@ struct gb_module *gb_module_find(struct greybus_host_device *hd, u8 module_id)
struct gb_module *module = NULL;
struct module_find find;
+ if (!module_id)
+ return NULL;
+
find.module_id = module_id;
find.endo = hd->endo;