[PATCH 3/3] dm: core: regmap: Avoid multiple calls to ofnode_get_parent()

Simon Glass sjg at chromium.org
Tue Aug 6 23:51:40 CEST 2024


On Sun, 4 Aug 2024 at 09:06, Jonas Karlman <jonas at kwiboo.se> wrote:
>
> Until a live tree is used in U-Boot proper after relocation, use of
> ofnode_get_parent() will trigger a call to the very expensive
> fdt_parent_offset(), as detailed by the function documentation:
>
>   NOTE: This function is expensive, as it must scan the device tree
>   structure from the start to nodeoffset, *twice*.
>
> Re-use the returned value from a single call instead of having to make
> multiple calls for same node.
>
> Signed-off-by: Jonas Karlman <jonas at kwiboo.se>
> ---
>  drivers/core/regmap.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list