0c45679e9dd317a20056a38800f1fbfdc601c72c
[openwrt/staging/xback.git] /
1 From ff24fed10ba414d19579e26e60b126fad2f2bb07 Mon Sep 17 00:00:00 2001
2 From: Michael Walle <michael@walle.cc>
3 Date: Mon, 6 Feb 2023 13:43:44 +0000
4 Subject: [PATCH] of: property: make #.*-cells optional for simple props
5
6 Sometimes, future bindings for phandles will get additional arguments.
7 Thus the target node of the phandle will need a new #.*-cells property.
8 To be backwards compatible, this needs to be optional.
9
10 Prepare the DEFINE_SIMPLE_PROPS() to handle the cells name as optional.
11
12 Signed-off-by: Michael Walle <michael@walle.cc>
13 Tested-by: Miquel Raynal <miquel.raynal@bootlin.com>
14 Reviewed-by: Rob Herring <robh@kernel.org>
15 Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
16 Link: https://lore.kernel.org/r/20230206134356.839737-11-srinivas.kandagatla@linaro.org
17 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
18 ---
19 drivers/of/property.c | 4 ++--
20 1 file changed, 2 insertions(+), 2 deletions(-)
21
22 --- a/drivers/of/property.c
23 +++ b/drivers/of/property.c
24 @@ -1213,8 +1213,8 @@ static struct device_node *parse_prop_ce
25 if (strcmp(prop_name, list_name))
26 return NULL;
27
28 - if (of_parse_phandle_with_args(np, list_name, cells_name, index,
29 - &sup_args))
30 + if (__of_parse_phandle_with_args(np, list_name, cells_name, 0, index,
31 + &sup_args))
32 return NULL;
33
34 return sup_args.np;