summaryrefslogtreecommitdiff
path: root/include/linux/property.h
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2017-03-28 10:52:18 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-03-29 01:00:27 +0300
commit34055190b19d7c634caf738c8ca195cad06550cd (patch)
tree282a24612b1c5c363cb30f2c29d8e96cadbcd51c /include/linux/property.h
parentafaf26fd8458be29949ae5a52c65a464a1b0cbb6 (diff)
downloadlinux-34055190b19d7c634caf738c8ca195cad06550cd.tar.xz
ACPI / property: Add fwnode_get_next_child_node()
The ACPI _DSD hierarchical data extension makes it possible to have hierarchies deeper than one level in similar way than DT allows. These "subsubnodes" have not been accessible because device property implementation only provides device_get_next_child_node() that is limited to direct descendants of a device. We need this ability in order support things like remote endpoints currently supported in DT with of_graph_* APIs. Modify acpi_get_next_subnode() to accept fwnode handle instead and update callers accordingly. Also add a new function fwnode_get_next_child_node() that works directly with fwnodes and modify device_get_next_child_node() to call it directly. While there add a macro fwnode_for_each_child_node() analogous to the current device_for_each_child_node() but it works with fwnodes instead of devices. Link: http://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.pdf Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/property.h')
-rw-r--r--include/linux/property.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/property.h b/include/linux/property.h
index ab0a8160cef6..f4786a8655f1 100644
--- a/include/linux/property.h
+++ b/include/linux/property.h
@@ -71,6 +71,12 @@ int fwnode_property_match_string(struct fwnode_handle *fwnode,
const char *propname, const char *string);
struct fwnode_handle *fwnode_get_parent(struct fwnode_handle *fwnode);
+struct fwnode_handle *fwnode_get_next_child_node(struct fwnode_handle *fwnode,
+ struct fwnode_handle *child);
+
+#define fwnode_for_each_child_node(fwnode, child) \
+ for (child = fwnode_get_next_child_node(fwnode, NULL); child; \
+ child = fwnode_get_next_child_node(fwnode, child))
struct fwnode_handle *device_get_next_child_node(struct device *dev,
struct fwnode_handle *child);