Thread (15 messages) 15 messages, 2 authors, 2017-02-07
STALE3455d
Revisions (4)
  1. v1 [diff vs current]
  2. v2 current
  3. v3 [diff vs current]
  4. v5 [diff vs current]

[PATCH v2 13/16] device property: Get endpoint index from the ACPI tables

From: Sakari Ailus <sakari.ailus@linux.intel.com>
Date: 2017-02-02 16:22:23
Also in: linux-acpi
Subsystem: driver core, kobjects, debugfs and sysfs, software nodes and device properties, the rest · Maintainers: Greg Kroah-Hartman, "Rafael J. Wysocki", Danilo Krummrich, Linus Torvalds

On ACPI, find the child node index instead of relying on the "endpoint"
property.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/base/property.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/base/property.c b/drivers/base/property.c
index 3f77404..28125a5 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -1266,8 +1266,14 @@ int fwnode_graph_parse_endpoint(struct fwnode_handle *fwnode,
 	 * If they don't then the default value 0 is used.
 	 */
 	if (is_acpi_node(port_fwnode)) {
+		struct fwnode_handle *iter;
+
 		fwnode_property_read_u32(port_fwnode, "port", &endpoint->port);
-		fwnode_property_read_u32(fwnode, "endpoint", &endpoint->id);
+
+		for (iter = fwnode_get_next_child_node(port_fwnode, NULL);
+		     iter != fwnode;
+		     iter = fwnode_get_next_child_node(port_fwnode, iter))
+			endpoint->id++;
 	} else {
 		fwnode_property_read_u32(port_fwnode, "reg", &endpoint->port);
 		fwnode_property_read_u32(fwnode, "reg", &endpoint->id);
-- 
2.7.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help