diff options
author | Greg Kroah-Hartman <gregkh@google.com> | 2015-04-07 20:27:15 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2015-04-09 22:50:09 +0200 |
commit | a4d9150cbaafd0d58eff54ea928d155ae582aa9c (patch) | |
tree | 4c112329ee575fd360419f1f30c1179c4fe93019 /drivers/staging/greybus/module.h | |
parent | 0f035acdedcb4f016c2b7cc23758d9191713d951 (diff) |
greybus: endo: hook up endos into the device tree
This hooks up the endo, and modules, into the device tree. All modules
for a specific endo are created when the host device is initialized.
When an interface is registered, the correct module for it is found and
that module is used for the sysfs tree. When the interface is removed,
the reference on the module is dropped.
When the host device goes away, the whole endo and modules are removed
at once.
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Diffstat (limited to 'drivers/staging/greybus/module.h')
-rw-r--r-- | drivers/staging/greybus/module.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/staging/greybus/module.h b/drivers/staging/greybus/module.h index f3e3bdd6a671..c23ac98fc1ba 100644 --- a/drivers/staging/greybus/module.h +++ b/drivers/staging/greybus/module.h @@ -13,16 +13,15 @@ struct gb_module { struct device dev; u8 module_id; /* Physical location within the Endo */ - u16 refcount; }; #define to_gb_module(d) container_of(d, struct gb_module, dev) struct greybus_host_device; /* Greybus "private" definitions */ -struct gb_module *gb_module_find_or_create(struct greybus_host_device *hd, - u8 module_id); -void gb_module_remove(struct gb_module *module); +struct gb_module *gb_module_find(struct greybus_host_device *hd, u8 module_id); +struct gb_module *gb_module_create(struct device *parent, u8 module_id); +void gb_module_remove_all(struct gb_endo *endo); u8 get_module_id(u8 interface_id); |