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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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

Signed-off-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux