diff mbox series

[1/2] ARM: mxs: Do not search for "fsl,clkctrl"

Message ID 20231205144713.2053916-1-festevam@gmail.com (mailing list archive)
State New, archived
Headers show
Series [1/2] ARM: mxs: Do not search for "fsl,clkctrl" | expand

Commit Message

Fabio Estevam Dec. 5, 2023, 2:47 p.m. UTC
From: Fabio Estevam <festevam@denx.de>

The "fsl,clkctrl" compatible string is not documented.

It is used only to find the base address of the clock controller.

Instead of searching for an undocumented compatible string, search
for "fsl,imx23-clkctrl" and "fsl,imx28-clkctrl".

Signed-off-by: Fabio Estevam <festevam@denx.de>
---
 arch/arm/mach-mxs/mach-mxs.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Stefan Wahren Dec. 5, 2023, 6:49 p.m. UTC | #1
Hi Fabio,

Am 05.12.23 um 15:47 schrieb Fabio Estevam:
> From: Fabio Estevam <festevam@denx.de>
>
> The "fsl,clkctrl" compatible string is not documented.
>
> It is used only to find the base address of the clock controller.
>
> Instead of searching for an undocumented compatible string, search
> for "fsl,imx23-clkctrl" and "fsl,imx28-clkctrl".
>
> Signed-off-by: Fabio Estevam <festevam@denx.de>
> ---
>   arch/arm/mach-mxs/mach-mxs.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c
> index 3faf9a1e3e36..6e017fa306c8 100644
> --- a/arch/arm/mach-mxs/mach-mxs.c
> +++ b/arch/arm/mach-mxs/mach-mxs.c
> @@ -356,7 +356,9 @@ static int __init mxs_restart_init(void)
>   {
>   	struct device_node *np;
>
> -	np = of_find_compatible_node(NULL, NULL, "fsl,clkctrl");
> +	np = of_find_compatible_node(NULL, NULL, "fsl,imx23-clkctrl");
> +	if (!np)
> +		np = of_find_compatible_node(NULL, NULL, "fsl,imx28-clkctrl");
i'm fine with getting the rid off "fsl,clkctrl", but some lines below we
search for "fsl,imx23-clkctrl" again to adjust reset_addr.

Can we avoid this unnecessary search?
>   	reset_addr = of_iomap(np, 0);
>   	if (!reset_addr)
>   		return -ENODEV;
Shawn Guo Dec. 6, 2023, 3:22 a.m. UTC | #2
On Tue, Dec 05, 2023 at 11:47:12AM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@denx.de>
> 
> The "fsl,clkctrl" compatible string is not documented.
> 
> It is used only to find the base address of the clock controller.
> 
> Instead of searching for an undocumented compatible string, search
> for "fsl,imx23-clkctrl" and "fsl,imx28-clkctrl".
> 
> Signed-off-by: Fabio Estevam <festevam@denx.de>

Applied both, thanks!
diff mbox series

Patch

diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c
index 3faf9a1e3e36..6e017fa306c8 100644
--- a/arch/arm/mach-mxs/mach-mxs.c
+++ b/arch/arm/mach-mxs/mach-mxs.c
@@ -356,7 +356,9 @@  static int __init mxs_restart_init(void)
 {
 	struct device_node *np;
 
-	np = of_find_compatible_node(NULL, NULL, "fsl,clkctrl");
+	np = of_find_compatible_node(NULL, NULL, "fsl,imx23-clkctrl");
+	if (!np)
+		np = of_find_compatible_node(NULL, NULL, "fsl,imx28-clkctrl");
 	reset_addr = of_iomap(np, 0);
 	if (!reset_addr)
 		return -ENODEV;