Skip to contentSkip to conversation

dt-bindings: pwm: Avoid selecting schema on node name match

PATCH In review Thierry Reding 2 participants 2 messages Dec 7, 2021 – Dec 8, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dt-bindings: pwm: Avoid selecting schema on node name match

From: Thierry Reding <[email protected]>

Currently any node whose name starts with the "pwm-" prefix will match this schema and in turn required the "#pwm-cells" property. Avoid this by marking the schema with select: false, therefore only activating the schema when directly included from a PWM controller schema file.

---
Rob,

I've seen this used in some other schema files, but wanted to double-check with you if this is the correct solution for this problem.

Thanks,
Thierry

 Documentation/devicetree/bindings/pwm/pwm.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/pwm/pwm.yaml +2 -0
index 2effe6c0de6b..3c01f85029e5 100644
@@ -9,6 +9,8 @@ title: PWM controllers (providers)
 maintainers:
   - Thierry Reding <[email protected]>
 
+select: false
+
 properties:
   $nodename:
     pattern: "^pwm(@.*|-[0-9a-f])*$"
Signature · 1 line
2.33.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Thierry Reding

From: Thierry Reding <[email protected]>

Currently any node whose name starts with the "pwm-" prefix will match this schema and in turn required the "#pwm-cells" property. Avoid this by marking the schema with select: false, therefore only activating the schema when directly included from a PWM controller schema file.

Pinctrl nodes? I'd rather change pin node names.

Quoted 7 lines

---
Rob,

I've seen this used in some other schema files, but wanted to double-check with you if this is the correct solution for this problem.

I suppose this is fine. This schema is just about pointless as each producer has to define #pwm-cells anyways.

Quoted 24 lines

Thanks,
Thierry

 Documentation/devicetree/bindings/pwm/pwm.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/pwm/pwm.yaml +2 -0
index 2effe6c0de6b..3c01f85029e5 100644
@@ -9,6 +9,8 @@ title: PWM controllers (providers)
 maintainers:
   - Thierry Reding <[email protected]>
 
+select: false
+
 properties:
   $nodename:
     pattern: "^pwm(@.*|-[0-9a-f])*$"
Signature · 1 line
2.33.1