mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 22:02:02 +00:00
greybus: core: add drvdata accessors
Add greybus driver-data accessors. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
parent
b787d413e0
commit
13da9e11e9
1 changed files with 10 additions and 0 deletions
|
@ -72,6 +72,16 @@ struct greybus_driver {
|
|||
};
|
||||
#define to_greybus_driver(d) container_of(d, struct greybus_driver, driver)
|
||||
|
||||
static inline void greybus_set_drvdata(struct gb_bundle *bundle, void *data)
|
||||
{
|
||||
dev_set_drvdata(&bundle->dev, data);
|
||||
}
|
||||
|
||||
static inline void *greybus_get_drvdata(struct gb_bundle *bundle)
|
||||
{
|
||||
return dev_get_drvdata(&bundle->dev);
|
||||
}
|
||||
|
||||
/* Don't call these directly, use the module_greybus_driver() macro instead */
|
||||
int greybus_register_driver(struct greybus_driver *driver,
|
||||
struct module *module, const char *mod_name);
|
||||
|
|
Loading…
Reference in a new issue