Re: [PATCH] dt-bindings: leds: Add missing (unevaluated|additional)Properties on child nodes

From: Pavel Machek
Date: Tue Aug 23 2022 - 15:34:41 EST


Hi!

> In order to ensure only documented properties are present, node schemas
> must have unevaluatedProperties or additionalProperties set to false
> (typically).
>
> Signed-off-by: Rob Herring <robh@xxxxxxxxxx>

Patch does way more than that:

Can we get some explanation why that's correct?

Best regards,
Pavel

> index f8d7963c3a13..8b3b3bf1eaf2 100644
> --- a/Documentation/devicetree/bindings/leds/leds-lgm.yaml
> +++ b/Documentation/devicetree/bindings/leds/leds-lgm.yaml
> @@ -56,7 +56,8 @@ properties:
>
> patternProperties:
> "^led@[0-2]$":
> - type: object
> + $ref: common.yaml#
> + unevaluatedProperties: false
>
> properties:
> reg:
> @@ -64,6 +65,9 @@ properties:
> minimum: 0
> maximum: 2
>
> + led-gpios:
> + maxItems: 1
> +
> intel,sso-hw-trigger:
> type: boolean
> description: This property indicates Hardware driven/control LED.
> @@ -118,14 +122,14 @@ examples:
> reg = <0>;
> function = "gphy";
> color = <LED_COLOR_ID_GREEN>;
> - led-gpio = <&ssogpio 0 0>;
> + led-gpios = <&ssogpio 0 0>;
> };
>
> led@2 {
> reg = <2>;
> function = LED_FUNCTION_POWER;
> color = <LED_COLOR_ID_GREEN>;
> - led-gpio = <&ssogpio 23 0>;
> + led-gpios = <&ssogpio 23 0>;
> };
> };
> };

--
People of Russia, stop Putin before his war on Ukraine escalates.

Attachment: signature.asc
Description: PGP signature