lkml.org 
[lkml]   [2022]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v6 03/35] component: Add aggregate_device_parent() for driver use
Date
This allows aggregate driver writers to get the parent of the aggregate
device passed to their probe/remove/shutdown functions.

Suggested-by: Jani Nikula <jani.nikula@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Saravana Kannan <saravanak@google.com>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
---
drivers/base/component.c | 6 ++++++
include/linux/component.h | 1 +
2 files changed, 7 insertions(+)

diff --git a/drivers/base/component.c b/drivers/base/component.c
index dc748ef0b23b..13ac2004a913 100644
--- a/drivers/base/component.c
+++ b/drivers/base/component.c
@@ -71,6 +71,12 @@ static inline struct aggregate_device *to_aggregate_device(struct device *d)
return container_of(d, struct aggregate_device, dev);
}

+struct device *aggregate_device_parent(const struct aggregate_device *adev)
+{
+ return adev->parent;
+}
+EXPORT_SYMBOL_GPL(aggregate_device_parent);
+
struct component {
struct list_head node;
struct aggregate_device *adev;
diff --git a/include/linux/component.h b/include/linux/component.h
index aa69ea0401d3..c39dea7824af 100644
--- a/include/linux/component.h
+++ b/include/linux/component.h
@@ -43,6 +43,7 @@ int component_bind_all(struct device *parent, void *data);
void component_unbind_all(struct device *parent, void *data);

struct aggregate_device;
+struct device *aggregate_device_parent(const struct aggregate_device *adev);

/**
* struct component_master_ops - callback for the aggregate driver
--
https://chromeos.dev
\
 
 \ /
  Last update: 2022-01-27 21:02    [W:0.597 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site