[PATCH v5 1/3] dt-bindings: iio: adc: Fix channel property validation

Chi-Wen Weng cwweng.linux at gmail.com
Tue Nov 17 00:28:30 PST 2026


From: Chi-Wen Weng <cwweng at nuvoton.com>

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 at kernel.org>
Signed-off-by: Chi-Wen Weng <cwweng at nuvoton.com>
---
 .../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




More information about the linux-arm-kernel mailing list