2021-12-16 02:31:56

by David E. Box

[permalink] [raw]
Subject: [PATCH V4 2/6] driver core: auxiliary bus: Add driver data helpers

Adds get/set driver data helpers for auxiliary devices.

Signed-off-by: David E. Box <[email protected]>
Reviewed-by: Mark Gross <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
---
V4
- No changes
V3
- No changes
V2
- No changes

include/linux/auxiliary_bus.h | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/include/linux/auxiliary_bus.h b/include/linux/auxiliary_bus.h
index fc51d45f106b..a8338d456e81 100644
--- a/include/linux/auxiliary_bus.h
+++ b/include/linux/auxiliary_bus.h
@@ -28,6 +28,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);
--
2.25.1



2021-12-21 09:20:14

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH V4 2/6] driver core: auxiliary bus: Add driver data helpers

On Wed, Dec 15, 2021 at 06:31:42PM -0800, David E. Box wrote:
> Adds get/set driver data helpers for auxiliary devices.
>
> Signed-off-by: David E. Box <[email protected]>
> Reviewed-by: Mark Gross <[email protected]>
> Reviewed-by: Andy Shevchenko <[email protected]>
> ---

Acked-by: Greg Kroah-Hartman <[email protected]>