diff mbox series

ARM: dts: at91: Avoid colliding 'display' node and property names

Message ID 20190516225614.1458-1-robh@kernel.org (mailing list archive)
State Mainlined
Commit 8a6836ee384909ae01e3bd0731d082e0e6667e54
Headers show
Series ARM: dts: at91: Avoid colliding 'display' node and property names | expand

Commit Message

Rob Herring May 16, 2019, 10:56 p.m. UTC
While properties and child nodes with the same name are valid DT, the
practice is not encouraged. Furthermore, the collision is problematic for
YAML encoded DT. Let's just avoid the issue and rename the nodes.

Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
 arch/arm/boot/dts/at91sam9261ek.dts    | 2 +-
 arch/arm/boot/dts/at91sam9263ek.dts    | 2 +-
 arch/arm/boot/dts/at91sam9m10g45ek.dts | 2 +-
 arch/arm/boot/dts/at91sam9rlek.dts     | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

Comments

Nicolas Ferre May 20, 2019, 8:27 a.m. UTC | #1
On 17/05/2019 at 00:56, Rob Herring wrote:
> While properties and child nodes with the same name are valid DT, the
> practice is not encouraged. Furthermore, the collision is problematic for
> YAML encoded DT. Let's just avoid the issue and rename the nodes.
> 
> Cc: Nicolas Ferre <nicolas.ferre@microchip.com>

Good for me:
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>

> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
> Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>   arch/arm/boot/dts/at91sam9261ek.dts    | 2 +-
>   arch/arm/boot/dts/at91sam9263ek.dts    | 2 +-
>   arch/arm/boot/dts/at91sam9m10g45ek.dts | 2 +-
>   arch/arm/boot/dts/at91sam9rlek.dts     | 2 +-
>   4 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/at91sam9261ek.dts b/arch/arm/boot/dts/at91sam9261ek.dts
> index f681cd727010..02b116b48c3b 100644
> --- a/arch/arm/boot/dts/at91sam9261ek.dts
> +++ b/arch/arm/boot/dts/at91sam9261ek.dts
> @@ -49,7 +49,7 @@
>   			atmel,power-control-gpio = <&pioA 12 GPIO_ACTIVE_LOW>;
>   			status = "okay";
>   
> -			display0: display {
> +			display0: panel {
>   				bits-per-pixel = <16>;
>   				atmel,lcdcon-backlight;
>   				atmel,dmacon = <0x1>;
> diff --git a/arch/arm/boot/dts/at91sam9263ek.dts b/arch/arm/boot/dts/at91sam9263ek.dts
> index 13d415c22a69..924fe563f6fa 100644
> --- a/arch/arm/boot/dts/at91sam9263ek.dts
> +++ b/arch/arm/boot/dts/at91sam9263ek.dts
> @@ -111,7 +111,7 @@
>   			display = <&display0>;
>   			status = "okay";
>   
> -			display0: display {
> +			display0: panel {
>   				bits-per-pixel = <16>;
>   				atmel,lcdcon-backlight;
>   				atmel,dmacon = <0x1>;
> diff --git a/arch/arm/boot/dts/at91sam9m10g45ek.dts b/arch/arm/boot/dts/at91sam9m10g45ek.dts
> index 46107c2f1ab9..5226e952a729 100644
> --- a/arch/arm/boot/dts/at91sam9m10g45ek.dts
> +++ b/arch/arm/boot/dts/at91sam9m10g45ek.dts
> @@ -236,7 +236,7 @@
>   			display = <&display0>;
>   			status = "okay";
>   
> -			display0: display {
> +			display0: panel {
>   				bits-per-pixel = <32>;
>   				atmel,lcdcon-backlight;
>   				atmel,dmacon = <0x1>;
> diff --git a/arch/arm/boot/dts/at91sam9rlek.dts b/arch/arm/boot/dts/at91sam9rlek.dts
> index 27d8a1f44233..a000a459f17b 100644
> --- a/arch/arm/boot/dts/at91sam9rlek.dts
> +++ b/arch/arm/boot/dts/at91sam9rlek.dts
> @@ -37,7 +37,7 @@
>   			display = <&display0>;
>   			status = "okay";
>   
> -			display0: display {
> +			display0: panel {
>   				bits-per-pixel = <16>;
>   				atmel,lcdcon-backlight;
>   				atmel,dmacon = <0x1>;
>
Alexandre Belloni May 20, 2019, 2:58 p.m. UTC | #2
On 16/05/2019 17:56:14-0500, Rob Herring wrote:
> While properties and child nodes with the same name are valid DT, the
> practice is not encouraged.

I don't see anything mentioning that in the devicetree specification. I
think this is something you should add if you don't want that to happen
again.

> Furthermore, the collision is problematic for
> YAML encoded DT. Let's just avoid the issue and rename the nodes.
> 

Or maybe you should fix the tool ;)

Do you plan to enforce it at some point? How close are you?

> Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
> Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Rob Herring <robh@kernel.org>

Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

> ---
>  arch/arm/boot/dts/at91sam9261ek.dts    | 2 +-
>  arch/arm/boot/dts/at91sam9263ek.dts    | 2 +-
>  arch/arm/boot/dts/at91sam9m10g45ek.dts | 2 +-
>  arch/arm/boot/dts/at91sam9rlek.dts     | 2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/at91sam9261ek.dts b/arch/arm/boot/dts/at91sam9261ek.dts
> index f681cd727010..02b116b48c3b 100644
> --- a/arch/arm/boot/dts/at91sam9261ek.dts
> +++ b/arch/arm/boot/dts/at91sam9261ek.dts
> @@ -49,7 +49,7 @@
>  			atmel,power-control-gpio = <&pioA 12 GPIO_ACTIVE_LOW>;
>  			status = "okay";
>  
> -			display0: display {
> +			display0: panel {
>  				bits-per-pixel = <16>;
>  				atmel,lcdcon-backlight;
>  				atmel,dmacon = <0x1>;
> diff --git a/arch/arm/boot/dts/at91sam9263ek.dts b/arch/arm/boot/dts/at91sam9263ek.dts
> index 13d415c22a69..924fe563f6fa 100644
> --- a/arch/arm/boot/dts/at91sam9263ek.dts
> +++ b/arch/arm/boot/dts/at91sam9263ek.dts
> @@ -111,7 +111,7 @@
>  			display = <&display0>;
>  			status = "okay";
>  
> -			display0: display {
> +			display0: panel {
>  				bits-per-pixel = <16>;
>  				atmel,lcdcon-backlight;
>  				atmel,dmacon = <0x1>;
> diff --git a/arch/arm/boot/dts/at91sam9m10g45ek.dts b/arch/arm/boot/dts/at91sam9m10g45ek.dts
> index 46107c2f1ab9..5226e952a729 100644
> --- a/arch/arm/boot/dts/at91sam9m10g45ek.dts
> +++ b/arch/arm/boot/dts/at91sam9m10g45ek.dts
> @@ -236,7 +236,7 @@
>  			display = <&display0>;
>  			status = "okay";
>  
> -			display0: display {
> +			display0: panel {
>  				bits-per-pixel = <32>;
>  				atmel,lcdcon-backlight;
>  				atmel,dmacon = <0x1>;
> diff --git a/arch/arm/boot/dts/at91sam9rlek.dts b/arch/arm/boot/dts/at91sam9rlek.dts
> index 27d8a1f44233..a000a459f17b 100644
> --- a/arch/arm/boot/dts/at91sam9rlek.dts
> +++ b/arch/arm/boot/dts/at91sam9rlek.dts
> @@ -37,7 +37,7 @@
>  			display = <&display0>;
>  			status = "okay";
>  
> -			display0: display {
> +			display0: panel {
>  				bits-per-pixel = <16>;
>  				atmel,lcdcon-backlight;
>  				atmel,dmacon = <0x1>;
> -- 
> 2.20.1
>
Rob Herring July 15, 2019, 9:45 p.m. UTC | #3
On Mon, May 20, 2019 at 8:58 AM Alexandre Belloni
<alexandre.belloni@bootlin.com> wrote:
>
> On 16/05/2019 17:56:14-0500, Rob Herring wrote:
> > While properties and child nodes with the same name are valid DT, the
> > practice is not encouraged.
>
> I don't see anything mentioning that in the devicetree specification. I
> think this is something you should add if you don't want that to happen
> again.

I suppose, but I prefer tools to enforce it.

>
> > Furthermore, the collision is problematic for
> > YAML encoded DT. Let's just avoid the issue and rename the nodes.
> >
>
> Or maybe you should fix the tool ;)

You mean the YAML and JSON specifications because the problem is it is
not valid YAML? (I think YAML allowed it at one time, but it is
deprecated) The only way to fix it in the tool would be to define some
way to handle the collision like renaming properties and then undoing
that.

> Do you plan to enforce it at some point? How close are you?

Soon as this patch is merged. There's a switch in parsing tools to
disallow the collision, so it will be an error instead of a warning.

> > Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
> > Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
> > Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
> > Cc: linux-arm-kernel@lists.infradead.org
> > Signed-off-by: Rob Herring <robh@kernel.org>
>
> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

Is someone going to apply this?

Rob
Alexandre Belloni July 16, 2019, 10:15 a.m. UTC | #4
On 15/07/2019 15:45:24-0600, Rob Herring wrote:
> On Mon, May 20, 2019 at 8:58 AM Alexandre Belloni
> <alexandre.belloni@bootlin.com> wrote:
> >
> > On 16/05/2019 17:56:14-0500, Rob Herring wrote:
> > > While properties and child nodes with the same name are valid DT, the
> > > practice is not encouraged.
> >
> > I don't see anything mentioning that in the devicetree specification. I
> > think this is something you should add if you don't want that to happen
> > again.
> 
> I suppose, but I prefer tools to enforce it.
> 
> >
> > > Furthermore, the collision is problematic for
> > > YAML encoded DT. Let's just avoid the issue and rename the nodes.
> > >
> >
> > Or maybe you should fix the tool ;)
> 
> You mean the YAML and JSON specifications because the problem is it is
> not valid YAML? (I think YAML allowed it at one time, but it is
> deprecated) The only way to fix it in the tool would be to define some
> way to handle the collision like renaming properties and then undoing
> that.
> 
> > Do you plan to enforce it at some point? How close are you?
> 
> Soon as this patch is merged. There's a switch in parsing tools to
> disallow the collision, so it will be an error instead of a warning.
> 
> > > Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
> > > Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
> > > Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
> > > Cc: linux-arm-kernel@lists.infradead.org
> > > Signed-off-by: Rob Herring <robh@kernel.org>
> >
> > Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> 
> Is someone going to apply this?
> 

I'll apply it for the next cycle, sorry about that.
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/at91sam9261ek.dts b/arch/arm/boot/dts/at91sam9261ek.dts
index f681cd727010..02b116b48c3b 100644
--- a/arch/arm/boot/dts/at91sam9261ek.dts
+++ b/arch/arm/boot/dts/at91sam9261ek.dts
@@ -49,7 +49,7 @@ 
 			atmel,power-control-gpio = <&pioA 12 GPIO_ACTIVE_LOW>;
 			status = "okay";
 
-			display0: display {
+			display0: panel {
 				bits-per-pixel = <16>;
 				atmel,lcdcon-backlight;
 				atmel,dmacon = <0x1>;
diff --git a/arch/arm/boot/dts/at91sam9263ek.dts b/arch/arm/boot/dts/at91sam9263ek.dts
index 13d415c22a69..924fe563f6fa 100644
--- a/arch/arm/boot/dts/at91sam9263ek.dts
+++ b/arch/arm/boot/dts/at91sam9263ek.dts
@@ -111,7 +111,7 @@ 
 			display = <&display0>;
 			status = "okay";
 
-			display0: display {
+			display0: panel {
 				bits-per-pixel = <16>;
 				atmel,lcdcon-backlight;
 				atmel,dmacon = <0x1>;
diff --git a/arch/arm/boot/dts/at91sam9m10g45ek.dts b/arch/arm/boot/dts/at91sam9m10g45ek.dts
index 46107c2f1ab9..5226e952a729 100644
--- a/arch/arm/boot/dts/at91sam9m10g45ek.dts
+++ b/arch/arm/boot/dts/at91sam9m10g45ek.dts
@@ -236,7 +236,7 @@ 
 			display = <&display0>;
 			status = "okay";
 
-			display0: display {
+			display0: panel {
 				bits-per-pixel = <32>;
 				atmel,lcdcon-backlight;
 				atmel,dmacon = <0x1>;
diff --git a/arch/arm/boot/dts/at91sam9rlek.dts b/arch/arm/boot/dts/at91sam9rlek.dts
index 27d8a1f44233..a000a459f17b 100644
--- a/arch/arm/boot/dts/at91sam9rlek.dts
+++ b/arch/arm/boot/dts/at91sam9rlek.dts
@@ -37,7 +37,7 @@ 
 			display = <&display0>;
 			status = "okay";
 
-			display0: display {
+			display0: panel {
 				bits-per-pixel = <16>;
 				atmel,lcdcon-backlight;
 				atmel,dmacon = <0x1>;