Skip to contentSkip to conversation

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

PATCH In review Rob Herring 3 participants 5 messages May 16, 2019 – Jul 16, 2019

Subsystems (2)
lore
Share & tools
lore

Rob Herring

author maintainer
#0 lore raw

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

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 <[email protected]>
Cc Alexandre Belloni <[email protected]>
Cc Ludovic Desroches <[email protected]>
---
 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(-)
arch/arm/boot/dts/at91sam9261ek.dts +1 -1
index f681cd727010..02b116b48c3b 100644
@@ -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>;
arch/arm/boot/dts/at91sam9263ek.dts +1 -1
index 13d415c22a69..924fe563f6fa 100644
@@ -111,7 +111,7 @@
 			display = <&display0>;
 			status = "okay";
 
-			display0: display {
+			display0: panel {
 				bits-per-pixel = <16>;
 				atmel,lcdcon-backlight;
 				atmel,dmacon = <0x1>;
arch/arm/boot/dts/at91sam9m10g45ek.dts +1 -1
index 46107c2f1ab9..5226e952a729 100644
@@ -236,7 +236,7 @@
 			display = <&display0>;
 			status = "okay";
 
-			display0: display {
+			display0: panel {
 				bits-per-pixel = <32>;
 				atmel,lcdcon-backlight;
 				atmel,dmacon = <0x1>;
arch/arm/boot/dts/at91sam9rlek.dts +1 -1
index 27d8a1f44233..a000a459f17b 100644
@@ -37,7 +37,7 @@
 			display = <&display0>;
 			status = "okay";
 
-			display0: display {
+			display0: panel {
 				bits-per-pixel = <16>;
 				atmel,lcdcon-backlight;
 				atmel,dmacon = <0x1>;
Signature · 1 line
2.20.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Rob Herring

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 <[email protected]>

Good for me:

Quoted 64 lines
Cc Alexandre Belloni <[email protected]>
Cc Ludovic Desroches <[email protected]>
---
  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(-)
arch/arm/boot/dts/at91sam9261ek.dts +1 -1
index f681cd727010..02b116b48c3b 100644
@@ -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>;
arch/arm/boot/dts/at91sam9263ek.dts +1 -1
index 13d415c22a69..924fe563f6fa 100644
@@ -111,7 +111,7 @@
  			display = <&display0>;
  			status = "okay";
 
-			display0: display {
+			display0: panel {
  				bits-per-pixel = <16>;
  				atmel,lcdcon-backlight;
  				atmel,dmacon = <0x1>;
arch/arm/boot/dts/at91sam9m10g45ek.dts +1 -1
index 46107c2f1ab9..5226e952a729 100644
@@ -236,7 +236,7 @@
  			display = <&display0>;
  			status = "okay";
 
-			display0: display {
+			display0: panel {
  				bits-per-pixel = <32>;
  				atmel,lcdcon-backlight;
  				atmel,dmacon = <0x1>;
arch/arm/boot/dts/at91sam9rlek.dts +1 -1
index 27d8a1f44233..a000a459f17b 100644
@@ -37,7 +37,7 @@
  			display = <&display0>;
  			status = "okay";
 
-			display0: display {
+			display0: panel {
  				bits-per-pixel = <16>;
  				atmel,lcdcon-backlight;
  				atmel,dmacon = <0x1>;
Signature · 1 line
Nicolas Ferre
maintainer Acked-by on v1 1/1
#2 lore raw
In reply to Rob Herring
Quoted 2 lines · Rob Herring

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.

Quoted 3 lines

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?

Quoted 5 lines
Cc Nicolas Ferre <[email protected]>
Cc Alexandre Belloni <[email protected]>
Cc Ludovic Desroches <[email protected]>
Quoted 62 lines
---
 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(-)
arch/arm/boot/dts/at91sam9261ek.dts +1 -1
index f681cd727010..02b116b48c3b 100644
@@ -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>;
arch/arm/boot/dts/at91sam9263ek.dts +1 -1
index 13d415c22a69..924fe563f6fa 100644
@@ -111,7 +111,7 @@
 			display = <&display0>;
 			status = "okay";
 
-			display0: display {
+			display0: panel {
 				bits-per-pixel = <16>;
 				atmel,lcdcon-backlight;
 				atmel,dmacon = <0x1>;
arch/arm/boot/dts/at91sam9m10g45ek.dts +1 -1
index 46107c2f1ab9..5226e952a729 100644
@@ -236,7 +236,7 @@
 			display = <&display0>;
 			status = "okay";
 
-			display0: display {
+			display0: panel {
 				bits-per-pixel = <32>;
 				atmel,lcdcon-backlight;
 				atmel,dmacon = <0x1>;
arch/arm/boot/dts/at91sam9rlek.dts +1 -1
index 27d8a1f44233..a000a459f17b 100644
@@ -37,7 +37,7 @@
 			display = <&display0>;
 			status = "okay";
 
-			display0: display {
+			display0: panel {
 				bits-per-pixel = <16>;
 				atmel,lcdcon-backlight;
 				atmel,dmacon = <0x1>;
Signature · 1 line
2.20.1
Signature · 3 lines
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
author maintainer
#3 lore raw
Quoted 8 lines · Alexandre Belloni
Quoted 2 lines · Rob Herring

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.

Quoted 6 lines
Quoted 4 lines

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.

Quoted 1 line

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.

Quoted 7 lines
Quoted 5 lines
Cc Nicolas Ferre <[email protected]>
Cc Alexandre Belloni <[email protected]>
Cc Ludovic Desroches <[email protected]>

Is someone going to apply this?

Rob

#4 lore raw
Quoted 37 lines · Rob Herring
Quoted 8 lines · Alexandre Belloni
Quoted 2 lines · Rob Herring

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.

Quoted 6 lines
Quoted 4 lines

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.

Quoted 1 line

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.

Quoted 6 lines
Quoted 5 lines
Cc Nicolas Ferre <[email protected]>
Cc Alexandre Belloni <[email protected]>
Cc Ludovic Desroches <[email protected]>
Quoted 4 lines
Quoted 1 line

Is someone going to apply this?

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

Signature · 3 lines
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com