* [PATCH] of/fdt: Check against '/chosen' in early_init_dt_scan_chosen
@ 2021-01-26 1:51 Chris Packham
2021-01-26 2:07 ` Rob Herring
0 siblings, 1 reply; 2+ messages in thread
From: Chris Packham @ 2021-01-26 1:51 UTC (permalink / raw)
To: robh+dt, frowand.list, arch0.zheng
Cc: devicetree, linux-kernel, Chris Packham
of_scan_flat_dt() passes the name of the visited node to the iterator.
In the case of '/chosen' this includes the leading '/'. Update
early_init_dt_scan_chosen() to expect this.
Fixes: 7536c7e03e74 ("of/fdt: Remove redundant kbasename function call")
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---
drivers/of/fdt.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index feb0f2d67fc5..861aedf0bb7c 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -1043,7 +1043,10 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
pr_debug("search \"chosen\", depth: %d, uname: %s\n", depth, uname);
if (depth != 1 || !data ||
- (strcmp(uname, "chosen") != 0 && strcmp(uname, "chosen@0") != 0))
+ (strcmp(uname, "chosen") != 0 &&
+ strcmp(uname, "chosen@0") != 0 &&
+ strcmp(uname, "/chosen") != 0 &&
+ strcmp(uname, "/chosen@0") != 0))
return 0;
early_init_dt_check_for_initrd(node);
--
2.30.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] of/fdt: Check against '/chosen' in early_init_dt_scan_chosen
2021-01-26 1:51 [PATCH] of/fdt: Check against '/chosen' in early_init_dt_scan_chosen Chris Packham
@ 2021-01-26 2:07 ` Rob Herring
0 siblings, 0 replies; 2+ messages in thread
From: Rob Herring @ 2021-01-26 2:07 UTC (permalink / raw)
To: Chris Packham; +Cc: Frank Rowand, Qi Zheng, devicetree, linux-kernel
On Mon, Jan 25, 2021 at 8:02 PM Chris Packham
<chris.packham@alliedtelesis.co.nz> wrote:
>
> of_scan_flat_dt() passes the name of the visited node to the iterator.
> In the case of '/chosen' this includes the leading '/'. Update
> early_init_dt_scan_chosen() to expect this.
>
> Fixes: 7536c7e03e74 ("of/fdt: Remove redundant kbasename function call")
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> ---
> drivers/of/fdt.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> index feb0f2d67fc5..861aedf0bb7c 100644
> --- a/drivers/of/fdt.c
> +++ b/drivers/of/fdt.c
> @@ -1043,7 +1043,10 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
> pr_debug("search \"chosen\", depth: %d, uname: %s\n", depth, uname);
>
> if (depth != 1 || !data ||
> - (strcmp(uname, "chosen") != 0 && strcmp(uname, "chosen@0") != 0))
> + (strcmp(uname, "chosen") != 0 &&
> + strcmp(uname, "chosen@0") != 0 &&
> + strcmp(uname, "/chosen") != 0 &&
> + strcmp(uname, "/chosen@0") != 0))
2 out of 4 of those are wrong.
> return 0;
>
> early_init_dt_check_for_initrd(node);
> --
> 2.30.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-01-26 10:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-26 1:51 [PATCH] of/fdt: Check against '/chosen' in early_init_dt_scan_chosen Chris Packham
2021-01-26 2:07 ` Rob Herring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).