driver core: auxiliary bus: Add driver data helpers
authorDavid E. Box <david.e.box@linux.intel.com>
Wed, 8 Dec 2021 01:50:11 +0000 (17:50 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Dec 2021 12:56:19 +0000 (13:56 +0100)
Adds get/set driver data helpers for auxiliary devices.

Reviewed-by: Mark Gross <markgross@kernel.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: David E. Box <david.e.box@linux.intel.com>
Link: https://lore.kernel.org/r/20211208015015.891275-3-david.e.box@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/auxiliary_bus.h

index e6d8b5c1622662972e0fd0da1bb901e832319238..de21d9d24a95fb6c0fb7e8ead73bdff6d1c1ccf8 100644 (file)
@@ -188,6 +188,16 @@ struct auxiliary_driver {
        const struct auxiliary_device_id *id_table;
 };
 
+static inline void *auxiliary_get_drvdata(struct auxiliary_device *auxdev)
+{
+       return dev_get_drvdata(&auxdev->dev);
+}
+
+static inline void auxiliary_set_drvdata(struct auxiliary_device *auxdev, void *data)
+{
+       dev_set_drvdata(&auxdev->dev, data);
+}
+
 static inline struct auxiliary_device *to_auxiliary_dev(struct device *dev)
 {
        return container_of(dev, struct auxiliary_device, dev);