95b0e60d564c54f3c228d89d64b3a1550bcc7467
[openwrt/staging/981213.git] /
1 From 4f4145c9fee8c7a445dbbbadceccce5391e6b287 Mon Sep 17 00:00:00 2001
2 From: Michael Walle <michael@walle.cc>
3 Date: Tue, 6 Dec 2022 21:07:22 +0100
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 ---
17 drivers/of/property.c | 4 ++--
18 1 file changed, 2 insertions(+), 2 deletions(-)
19
20 --- a/drivers/of/property.c
21 +++ b/drivers/of/property.c
22 @@ -1267,8 +1267,8 @@ static struct device_node *parse_suffix_
23 if (strcmp_suffix(prop_name, suffix))
24 return NULL;
25
26 - if (of_parse_phandle_with_args(np, prop_name, cells_name, index,
27 - &sup_args))
28 + if (__of_parse_phandle_with_args(np, prop_name, cells_name, 0, index,
29 + &sup_args))
30 return NULL;
31
32 return sup_args.np;