of: property: fw_devlink: Fix stupid bug in remote-endpoint parsing
authorSaravana Kannan <saravanak@google.com>
Sat, 24 Feb 2024 05:24:35 +0000 (21:24 -0800)
committerRob Herring <robh@kernel.org>
Fri, 1 Mar 2024 21:28:17 +0000 (15:28 -0600)
Introduced a stupid bug in commit 782bfd03c3ae ("of: property: Improve
finding the supplier of a remote-endpoint property") due to a last minute
incorrect edit of "index !=0" into "!index". This patch fixes it to be
"index > 0" to match the comment right next to it.

Reported-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://lore.kernel.org/lkml/20240223171849.10f9901d@booty/
Fixes: 782bfd03c3ae ("of: property: Improve finding the supplier of a remote-endpoint property")
Signed-off-by: Saravana Kannan <saravanak@google.com>
Reviewed-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Tested-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://lore.kernel.org/r/20240224052436.3552333-1-saravanak@google.com
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/of/property.c

index b71267c..fa8cd33 100644 (file)
@@ -1304,7 +1304,7 @@ static struct device_node *parse_remote_endpoint(struct device_node *np,
                                                 int index)
 {
        /* Return NULL for index > 0 to signify end of remote-endpoints. */
-       if (!index || strcmp(prop_name, "remote-endpoint"))
+       if (index > 0 || strcmp(prop_name, "remote-endpoint"))
                return NULL;
 
        return of_graph_get_remote_port_parent(np);