diff mbox series

[1/2] ARM: mxs: Add serial: Search for specific ocotp nodes

Message ID 20231009173740.3535167-1-festevam@gmail.com (mailing list archive)
State New, archived
Headers show
Series [1/2] ARM: mxs: Add serial: Search for specific ocotp nodes | expand

Commit Message

Fabio Estevam Oct. 9, 2023, 5:37 p.m. UTC
From: Fabio Estevam <festevam@denx.de>

Per mxs-ocotp.yaml, "fsl,ocotp" is not a valid entry.

"fsl,ocotp" is only used to indicate the location of the
struct device_node that points to the ocotp node.

Search for the specific "fsl,imx28-ocotp" and "fsl,imx23-ocotp"
instead and remove the undocumented "fsl,ocotp" fallback.

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

Comments

Shawn Guo Oct. 10, 2023, 2:44 a.m. UTC | #1
On Mon, Oct 09, 2023 at 02:37:39PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@denx.de>
> 
> Per mxs-ocotp.yaml, "fsl,ocotp" is not a valid entry.
> 
> "fsl,ocotp" is only used to indicate the location of the
> struct device_node that points to the ocotp node.
> 
> Search for the specific "fsl,imx28-ocotp" and "fsl,imx23-ocotp"
> instead and remove the undocumented "fsl,ocotp" fallback.

Since the compatible is being used, can we document it instead?

Shawn

> 
> 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..d16e638990da 100644
> --- a/arch/arm/mach-mxs/mach-mxs.c
> +++ b/arch/arm/mach-mxs/mach-mxs.c
> @@ -94,7 +94,9 @@ static const u32 *mxs_get_ocotp(void)
>  	if (once)
>  		return ocotp_words;
>  
> -	np = of_find_compatible_node(NULL, NULL, "fsl,ocotp");
> +	np = of_find_compatible_node(NULL, NULL, "fsl,imx28-ocotp");
> +	if (!np)
> +		np = of_find_compatible_node(NULL, NULL, "fsl,imx23-ocotp");
>  	ocotp_base = of_iomap(np, 0);
>  	WARN_ON(!ocotp_base);
>  
> -- 
> 2.34.1
>
diff mbox series

Patch

diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c
index 3faf9a1e3e36..d16e638990da 100644
--- a/arch/arm/mach-mxs/mach-mxs.c
+++ b/arch/arm/mach-mxs/mach-mxs.c
@@ -94,7 +94,9 @@  static const u32 *mxs_get_ocotp(void)
 	if (once)
 		return ocotp_words;
 
-	np = of_find_compatible_node(NULL, NULL, "fsl,ocotp");
+	np = of_find_compatible_node(NULL, NULL, "fsl,imx28-ocotp");
+	if (!np)
+		np = of_find_compatible_node(NULL, NULL, "fsl,imx23-ocotp");
 	ocotp_base = of_iomap(np, 0);
 	WARN_ON(!ocotp_base);