From: Johan Hovold Date: Fri, 8 Jan 2016 19:13:43 +0000 (+0100) Subject: greybus: core: add drvdata accessors X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=13da9e11e9b781e54fc5db6b65bdcdf6dd96022d;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git greybus: core: add drvdata accessors Add greybus driver-data accessors. Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/greybus.h b/drivers/staging/greybus/greybus.h index 405e56540a3a..27679468e997 100644 --- a/drivers/staging/greybus/greybus.h +++ b/drivers/staging/greybus/greybus.h @@ -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);