Skip to content
Commit 6050cb1c authored by Rob Herring's avatar Rob Herring Committed by Geert Uytterhoeven
Browse files

ARM: sh-mobile: Use of_cpu_node_to_id() to read CPU node 'reg'



Replace open coded CPU nodes reading of "reg" and translation to logical
ID with of_cpu_node_to_id().

The original code called of_parse_phandle() CONFIG_NR_CPUS times
regardless of the length of 'cpus'. Optimize the loop to bail out once
of_parse_phandle() fails as the end of 'cpus' property has been reached.

Signed-off-by: default avatarRob Herring <robh@kernel.org>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Tested-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230327205228.573456-1-robh@kernel.org


Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
parent fe15c26e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment