Commit 9ca4d62f authored by Viresh Kumar's avatar Viresh Kumar Committed by Greg Kroah-Hartman

greybus: module: move gb_module_find() to a more logical location

Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 577f5f97
......@@ -44,6 +44,17 @@ const struct greybus_module_id *gb_module_match_id(struct gb_module *gmod,
return NULL;
}
struct gb_module *gb_module_find(struct greybus_host_device *hd, u8 module_id)
{
struct gb_module *module;
list_for_each_entry(module, &hd->modules, links)
if (module->module_id == module_id)
return module;
return NULL;
}
static void greybus_module_release(struct device *dev)
{
struct gb_module *gmod = to_gb_module(dev);
......@@ -132,17 +143,6 @@ void gb_module_destroy(struct gb_module *gmod)
device_del(&gmod->dev);
}
struct gb_module *gb_module_find(struct greybus_host_device *hd, u8 module_id)
{
struct gb_module *module;
list_for_each_entry(module, &hd->modules, links)
if (module->module_id == module_id)
return module;
return NULL;
}
int
gb_module_interface_init(struct gb_module *gmod, u8 interface_id, u8 device_id)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment