mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] of: overlay: fix overly strict check for symbols
@ 2022-09-26 10:06 Michael Riesch
  2022-09-26 10:26 ` Ahmad Fatoum
  2022-09-30 12:25 ` Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Riesch @ 2022-09-26 10:06 UTC (permalink / raw)
  To: barebox; +Cc: Michael Riesch

The recent patch "of: overlay: improve error handling in
of_overlay_apply_tree" introduced overly strict checks for symbols
in the root device tree and the overlay. However, it is legal for
both to have no symbols. Fix the checks in order to implement the
status quo.

Fixes: bc475fd88810 ("of: overlay: improve error handling in of_overlay_apply_tree")
Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
---
 drivers/of/overlay.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c
index 0fc440fdcf..9d112b67f1 100644
--- a/drivers/of/overlay.c
+++ b/drivers/of/overlay.c
@@ -131,12 +131,12 @@ static int of_overlay_apply_symbols(struct device_node *root,
 
 	if (!overlay_symbols) {
 		pr_debug("overlay doesn't have a __symbols__ node\n");
-		return -EINVAL;
+		return 0;
 	}
 
 	if (!root_symbols) {
 		pr_info("root doesn't have a __symbols__ node\n");
-		return -EINVAL;
+		return 0;
 	}
 
 	list_for_each_entry(prop, &overlay_symbols->properties, list) {
-- 
2.30.2




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] of: overlay: fix overly strict check for symbols
  2022-09-26 10:06 [PATCH] of: overlay: fix overly strict check for symbols Michael Riesch
@ 2022-09-26 10:26 ` Ahmad Fatoum
  2022-09-30 12:25 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2022-09-26 10:26 UTC (permalink / raw)
  To: Michael Riesch, barebox

On 26.09.22 11:06, Michael Riesch wrote:
> The recent patch "of: overlay: improve error handling in
> of_overlay_apply_tree" introduced overly strict checks for symbols
> in the root device tree and the overlay. However, it is legal for
> both to have no symbols. Fix the checks in order to implement the
> status quo.
> 
> Fixes: bc475fd88810 ("of: overlay: improve error handling in of_overlay_apply_tree")
> Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>


Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

FWIW, we do such fixups on the emulated Virt platforms. The device tree comes
from QEMU and lacks symbols, still barebox applies an overlay with state
and environment nodes on top of it.

Cheers,
Ahmad

> ---
>  drivers/of/overlay.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c
> index 0fc440fdcf..9d112b67f1 100644
> --- a/drivers/of/overlay.c
> +++ b/drivers/of/overlay.c
> @@ -131,12 +131,12 @@ static int of_overlay_apply_symbols(struct device_node *root,
>  
>  	if (!overlay_symbols) {
>  		pr_debug("overlay doesn't have a __symbols__ node\n");
> -		return -EINVAL;
> +		return 0;
>  	}
>  
>  	if (!root_symbols) {
>  		pr_info("root doesn't have a __symbols__ node\n");
> -		return -EINVAL;
> +		return 0;
>  	}
>  
>  	list_for_each_entry(prop, &overlay_symbols->properties, list) {


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] of: overlay: fix overly strict check for symbols
  2022-09-26 10:06 [PATCH] of: overlay: fix overly strict check for symbols Michael Riesch
  2022-09-26 10:26 ` Ahmad Fatoum
@ 2022-09-30 12:25 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2022-09-30 12:25 UTC (permalink / raw)
  To: Michael Riesch; +Cc: barebox

On Mon, Sep 26, 2022 at 12:06:10PM +0200, Michael Riesch wrote:
> The recent patch "of: overlay: improve error handling in
> of_overlay_apply_tree" introduced overly strict checks for symbols
> in the root device tree and the overlay. However, it is legal for
> both to have no symbols. Fix the checks in order to implement the
> status quo.
> 
> Fixes: bc475fd88810 ("of: overlay: improve error handling in of_overlay_apply_tree")
> Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
> ---
>  drivers/of/overlay.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c
> index 0fc440fdcf..9d112b67f1 100644
> --- a/drivers/of/overlay.c
> +++ b/drivers/of/overlay.c
> @@ -131,12 +131,12 @@ static int of_overlay_apply_symbols(struct device_node *root,
>  
>  	if (!overlay_symbols) {
>  		pr_debug("overlay doesn't have a __symbols__ node\n");
> -		return -EINVAL;
> +		return 0;
>  	}
>  
>  	if (!root_symbols) {
>  		pr_info("root doesn't have a __symbols__ node\n");
> -		return -EINVAL;
> +		return 0;
>  	}
>  
>  	list_for_each_entry(prop, &overlay_symbols->properties, list) {
> -- 
> 2.30.2
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-30 12:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-26 10:06 [PATCH] of: overlay: fix overly strict check for symbols Michael Riesch
2022-09-26 10:26 ` Ahmad Fatoum
2022-09-30 12:25 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox