summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hovold <johan@hovoldconsulting.com>2016-01-08 20:13:43 +0100
committerGreg Kroah-Hartman <gregkh@google.com>2016-01-09 00:41:46 -0800
commit13da9e11e9b781e54fc5db6b65bdcdf6dd96022d (patch)
tree72400706755c2f7a46dede01da39e32e4c751994
parentb787d413e0d99ae74e21cdab600ea3c5b0886ec2 (diff)
downloadop-kernel-dev-13da9e11e9b781e54fc5db6b65bdcdf6dd96022d.zip
op-kernel-dev-13da9e11e9b781e54fc5db6b65bdcdf6dd96022d.tar.gz
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>
-rw-r--r--drivers/staging/greybus/greybus.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/staging/greybus/greybus.h b/drivers/staging/greybus/greybus.h
index 405e565..2767946 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);
OpenPOWER on IntegriCloud