[PATCH 05/18] of: of_path: always call of_partition_ensure_probed before resolving

Ulrich Ölmann u.oelmann at pengutronix.de
Thu Jun 1 00:00:35 PDT 2023


Hi Ahmad,

as it looks that you are going to create a v2 anyway, just a small typo
fix.

On Wed, May 31 2023 at 16:59 +0200, Ahmad Fatoum <a.fatoum at pengutronix.de> wrote:
> of_find_path may be called on a partition, whose parent device is not
> yet probed. state code solves that by calling of_partition_ensure_probed
> before of_find_path_by_nde, but really we should be doing that for all

s/of_find_path_by_nde/of_find_path_by_node/

Best regards
Ulrich


> calls to of_find_path. Do so.
>
> Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
> ---
>  common/state/state.c | 4 ----
>  drivers/of/of_path.c | 2 ++
>  2 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/common/state/state.c b/common/state/state.c
> index 6b4acbb32bcc..11cc86ff73be 100644
> --- a/common/state/state.c
> +++ b/common/state/state.c
> @@ -618,10 +618,6 @@ struct state *state_new_from_node(struct device_node *node, bool readonly)
>  	}
>  
>  #ifdef __BAREBOX__
> -	ret = of_partition_ensure_probed(partition_node);
> -	if (ret)
> -		goto out_release_state;
> -
>  	ret = of_find_path_by_node(partition_node, &state->backend_path, 0);
>  #else
>  	ret = of_get_devicepath(partition_node, &state->backend_path, &offset, &size);
> diff --git a/drivers/of/of_path.c b/drivers/of/of_path.c
> index 1268cf36ee5b..059690e9b8e8 100644
> --- a/drivers/of/of_path.c
> +++ b/drivers/of/of_path.c
> @@ -43,6 +43,8 @@ static int __of_find_path(struct device_node *node, const char *part, char **out
>  	struct cdev *cdev;
>  	bool add_bb = false;
>  
> +	of_partition_ensure_probed(node);
> +
>  	dev = of_find_device_by_node_path(node->full_name);
>  	if (!dev) {
>  		int ret;
-- 
Pengutronix e.K.                           | Ulrich Ölmann               |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list