[RESEND PATCH 34/37] of: property: fix #nvmem-cell-cells parsing

From: Srinivas Kandagatla
Date: Mon Feb 06 2023 - 05:30:50 EST


From: Michael Walle <michael@xxxxxxxx>

Commit a80b3e6fb414 ("of: property: make #.*-cells optional for simple
props") claims to make the cells-name property optional for simple
properties, but changed the code for the wrong property, i.e. for
DEFINE_SUFFIX_PROP(). Fix that.

Fixes: a80b3e6fb414 ("of: property: make #.*-cells optional for simple props")
Reported-by: Peng Fan <peng.fan@xxxxxxx>
Signed-off-by: Michael Walle <michael@xxxxxxxx>
Acked-by: Rob Herring <robh@xxxxxxxxxx>
Tested-by: Robert Marko <robimarko@xxxxxxxxx>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxx>
---
drivers/of/property.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/of/property.c b/drivers/of/property.c
index 8d9ba20a8f90..95b838185b2f 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -1202,8 +1202,8 @@ static struct device_node *parse_prop_cells(struct device_node *np,
if (strcmp(prop_name, list_name))
return NULL;

- if (of_parse_phandle_with_args(np, list_name, cells_name, index,
- &sup_args))
+ if (__of_parse_phandle_with_args(np, list_name, cells_name, 0, index,
+ &sup_args))
return NULL;

return sup_args.np;
@@ -1256,8 +1256,8 @@ static struct device_node *parse_suffix_prop_cells(struct device_node *np,
if (strcmp_suffix(prop_name, suffix))
return NULL;

- if (__of_parse_phandle_with_args(np, prop_name, cells_name, 0, index,
- &sup_args))
+ if (of_parse_phandle_with_args(np, prop_name, cells_name, index,
+ &sup_args))
return NULL;

return sup_args.np;
--
2.25.1