Re: [PATCH 1/2] dt-bindings: hwmon: national,lm90: Fix channel constraints for temperature offset

From: Conor Dooley

Date: Tue Aug 25 2026 - 12:59:27 EST


On Mon, Aug 24, 2026 at 09:38:59PM +0300, Flaviu Nistor wrote:
> Limit temperature-offset-millicelsius to remote channels only, since
> channel 0 is local and this property does not apply to it.
> Channel 2 is only valid on devices with two remote sensors, so reject
> channel 2 for compatibles that do not support a second remote channel.
>
> Signed-off-by: Flaviu Nistor <flaviu.nistor@xxxxxxxxx>
> ---
> .../bindings/hwmon/national,lm90.yaml | 29 +++++++++++++++++--
> 1 file changed, 26 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/hwmon/national,lm90.yaml b/Documentation/devicetree/bindings/hwmon/national,lm90.yaml
> index 164068ba069d..a7f82b202b86 100644
> --- a/Documentation/devicetree/bindings/hwmon/national,lm90.yaml
> +++ b/Documentation/devicetree/bindings/hwmon/national,lm90.yaml
> @@ -113,6 +113,29 @@ allOf:
> properties:
> ti,extended-range-enable: false
>
> + - patternProperties:
> + "channel@0":
> + type: object
> + properties:
> + temperature-offset-millicelsius: false

Instead of this, could the two if/then blocks below grow an else with
this instead? What you've got here is a bit abnormal.

Cheers,
Conor.

> +
> + - if:
> + not:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - adi,adt7481
> + - dallas,max6695
> + - dallas,max6696
> + then:
> + patternProperties:
> + "^channel@[0-1]$":
> + properties:
> + reg:
> + enum: [0, 1]
> + "channel@2": false
> +
> - if:
> properties:
> compatible:
> @@ -149,7 +172,7 @@ allOf:
> - onnn,nct1008
> then:
> patternProperties:
> - "^channel@([0-2])$":
> + "^channel@([1-2])$":
> properties:
> temperature-offset-millicelsius:
> maximum: 127750
> @@ -172,7 +195,7 @@ allOf:
> - winbond,w83l771
> then:
> patternProperties:
> - "^channel@([0-2])$":
> + "^channel@([1-2])$":
> properties:
> temperature-offset-millicelsius:
> maximum: 127875
> @@ -186,7 +209,7 @@ allOf:
> - ti,tmp461
> then:
> patternProperties:
> - "^channel@([0-2])$":
> + "^channel@([1-2])$":
> properties:
> temperature-offset-millicelsius:
> maximum: 127937
> --
> 2.34.1
>

Attachment: signature.asc
Description: PGP signature