diff mbox series

[V3,2/6] driver core: auxiliary bus: Add driver data helpers

Message ID 20211213175921.1897860-3-david.e.box@linux.intel.com (mailing list archive)
State Changes Requested, archived
Headers show
Series Auxiliary bus driver support for Intel PCIe VSEC/DVSEC | expand

Commit Message

David E. Box Dec. 13, 2021, 5:59 p.m. UTC
Adds get/set driver data helpers for auxiliary devices.

Signed-off-by: David E. Box <david.e.box@linux.intel.com>
Reviewed-by: Mark Gross <markgross@kernel.org>
---
V3
  - No changes
V2
  - No changes

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

Comments

Andy Shevchenko Dec. 13, 2021, 6:04 p.m. UTC | #1
On Mon, Dec 13, 2021 at 09:59:17AM -0800, David E. Box wrote:
> Adds get/set driver data helpers for auxiliary devices.

I though I gave you a tag... Hint: use `b4 am ...` against previous version and
you won't lose the individual tags.

Anyway,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> Signed-off-by: David E. Box <david.e.box@linux.intel.com>
> Reviewed-by: Mark Gross <markgross@kernel.org>
> ---
> 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
>
David E. Box Dec. 13, 2021, 6:19 p.m. UTC | #2
On Mon, 2021-12-13 at 20:04 +0200, Andy Shevchenko wrote:
> On Mon, Dec 13, 2021 at 09:59:17AM -0800, David E. Box wrote:
> > Adds get/set driver data helpers for auxiliary devices.
> 
> I though I gave you a tag... Hint: use `b4 am ...` against previous version
> and
> you won't lose the individual tags.

Sorry I did drop it. Thanks for the tip.

David

> 
> Anyway,
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> > Signed-off-by: David E. Box <david.e.box@linux.intel.com>
> > Reviewed-by: Mark Gross <markgross@kernel.org>
> > ---
> > 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
> >
diff mbox series

Patch

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);