[PATCH v5 1/3] dt-bindings: iio: adc: Fix channel property validation
From: Chi-Wen Weng
Date: Tue Nov 17 2026 - 03:29:33 EST
From: Chi-Wen Weng <cwweng@xxxxxxxxxxx>
The common ADC channel binding currently uses an anyOf constraint
to require the reg property and select between single-channel and
diff-channels.
However, the reg-only branch allows validation to succeed even when
both single-channel and diff-channels are present, bypassing the
intended mutual exclusion.
Replace the anyOf constraint with an explicit reg requirement and
a not constraint that rejects channels specifying both properties.
This preserves support for reg-only, single-ended and differential
channel descriptions while rejecting conflicting configurations.
Fixes: dd471a2b7759 ("dt-bindings: iio: adc: Add single-channel property")
Suggested-by: Rob Herring <robh@xxxxxxxxxx>
Signed-off-by: Chi-Wen Weng <cwweng@xxxxxxxxxxx>
---
.../devicetree/bindings/iio/adc/adc.yaml | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/Documentation/devicetree/bindings/iio/adc/adc.yaml b/Documentation/devicetree/bindings/iio/adc/adc.yaml
index b673eaa5d072..f2a16b896630 100644
--- a/Documentation/devicetree/bindings/iio/adc/adc.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/adc.yaml
@@ -114,15 +114,12 @@ properties:
Burn-out current sources provide current to the channel's input pins for
open-circuit or short-circuit detection.
-anyOf:
- - oneOf:
- - required:
- - reg
- - diff-channels
- - required:
- - reg
- - single-channel
- - required:
- - reg
+required:
+ - reg
+
+not:
+ required:
+ - single-channel
+ - diff-channels
additionalProperties: true
--
2.25.1