]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
greybus: core: add drvdata accessors
authorJohan Hovold <johan@hovoldconsulting.com>
Fri, 8 Jan 2016 19:13:43 +0000 (20:13 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Sat, 9 Jan 2016 08:41:46 +0000 (00:41 -0800)
Add greybus driver-data accessors.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/greybus.h

index 405e56540a3a6b6002653b7a92c0a8125ce63b68..27679468e99791482d8f99c50d8916040ff95c85 100644 (file)
@@ -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);