mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
ACPI: property: Rework acpi_graph_get_next_endpoint()
Rework the code obtaining the next endpoint in acpi_graph_get_next_endpoint(). The resulting code removes unnecessary contitionals and should be easier to follow. Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://patch.msgid.link/20251001104320.1272752-4-sakari.ailus@linux.intel.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
committed by
Rafael J. Wysocki
parent
5d010473cd
commit
b889ed5abf
@@ -1491,14 +1491,17 @@ static struct fwnode_handle *acpi_graph_get_next_endpoint(
|
||||
if (!port)
|
||||
return NULL;
|
||||
|
||||
endpoint = acpi_get_next_subnode(port, prev);
|
||||
while (!endpoint) {
|
||||
port = acpi_get_next_subnode(fwnode, port);
|
||||
if (!port)
|
||||
do {
|
||||
endpoint = acpi_get_next_subnode(port, prev);
|
||||
if (endpoint)
|
||||
break;
|
||||
if (is_acpi_graph_node(port, "port"))
|
||||
endpoint = acpi_get_next_subnode(port, NULL);
|
||||
}
|
||||
|
||||
prev = NULL;
|
||||
|
||||
do {
|
||||
port = acpi_get_next_subnode(fwnode, port);
|
||||
} while (port && !is_acpi_graph_node(port, "port"));
|
||||
} while (port);
|
||||
|
||||
/*
|
||||
* The names of the endpoint nodes begin with "endpoint@" followed by
|
||||
|
||||
Reference in New Issue
Block a user