[1/2] dt-bindings: mfd: st,stpmic1: Add missing unevaluatedProperties for each regulator

Message ID 20230725123740.149559-1-krzysztof.kozlowski@linaro.org
State New
Headers
Series [1/2] dt-bindings: mfd: st,stpmic1: Add missing unevaluatedProperties for each regulator |

Commit Message

Krzysztof Kozlowski July 25, 2023, 12:37 p.m. UTC
  Each regulator node, which references common regulator.yaml schema,
should disallow additional or unevaluated properties.  Otherwise
mistakes in properties will go unnoticed.  unevaluatedProperties:false
requires listing existing properties (present in example and in other
regulators of this device).

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 Documentation/devicetree/bindings/mfd/st,stpmic1.yaml | 10 ++++++++++
 1 file changed, 10 insertions(+)
  

Comments

Krzysztof Kozlowski July 25, 2023, 2:45 p.m. UTC | #1
On 25/07/2023 14:37, Krzysztof Kozlowski wrote:
> Each regulator node, which references common regulator.yaml schema,
> should disallow additional or unevaluated properties.  Otherwise
> mistakes in properties will go unnoticed.  unevaluatedProperties:false
> requires listing existing properties (present in example and in other
> regulators of this device).
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  Documentation/devicetree/bindings/mfd/st,stpmic1.yaml | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml
> index 97c61097f9e2..1a1ced489ef7 100644
> --- a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml
> +++ b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml
> @@ -189,6 +189,16 @@ properties:
>  
>        "^(buck[1-4]|ldo[1-6]|boost|vref_ddr|pwr_sw[1-2])$":
>          $ref: ../regulator/regulator.yaml
> +        unevaluatedProperties: false
> +
> +        properties:
> +          interrupts:
> +            maxItems: 1
> +
> +          st,mask-reset:
> +            description: mask reset for this regulator, the regulator configuration
> +              is maintained during pmic reset.
> +            $ref: /schemas/types.yaml#/definitions/flag

After further testing I see this patch is wrong. There are already
buck[1-4] entries, so this is duplicating things. I will send v2.

Best regards,
Krzysztof
  
Lee Jones Aug. 17, 2023, 11:52 a.m. UTC | #2
On Tue, 25 Jul 2023, Krzysztof Kozlowski wrote:

> On 25/07/2023 14:37, Krzysztof Kozlowski wrote:
> > Each regulator node, which references common regulator.yaml schema,
> > should disallow additional or unevaluated properties.  Otherwise
> > mistakes in properties will go unnoticed.  unevaluatedProperties:false
> > requires listing existing properties (present in example and in other
> > regulators of this device).
> > 
> > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > ---
> >  Documentation/devicetree/bindings/mfd/st,stpmic1.yaml | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml
> > index 97c61097f9e2..1a1ced489ef7 100644
> > --- a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml
> > +++ b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml
> > @@ -189,6 +189,16 @@ properties:
> >  
> >        "^(buck[1-4]|ldo[1-6]|boost|vref_ddr|pwr_sw[1-2])$":
> >          $ref: ../regulator/regulator.yaml
> > +        unevaluatedProperties: false
> > +
> > +        properties:
> > +          interrupts:
> > +            maxItems: 1
> > +
> > +          st,mask-reset:
> > +            description: mask reset for this regulator, the regulator configuration
> > +              is maintained during pmic reset.
> > +            $ref: /schemas/types.yaml#/definitions/flag
> 
> After further testing I see this patch is wrong. There are already
> buck[1-4] entries, so this is duplicating things. I will send v2.

Are you still planning on resending this set?
  
Lee Jones Aug. 18, 2023, 3:37 p.m. UTC | #3
On Fri, 18 Aug 2023, Krzysztof Kozlowski wrote:

> On 17/08/2023 13:52, Lee Jones wrote:
> > On Tue, 25 Jul 2023, Krzysztof Kozlowski wrote:
> > 
> >> On 25/07/2023 14:37, Krzysztof Kozlowski wrote:
> >>> Each regulator node, which references common regulator.yaml schema,
> >>> should disallow additional or unevaluated properties.  Otherwise
> >>> mistakes in properties will go unnoticed.  unevaluatedProperties:false
> >>> requires listing existing properties (present in example and in other
> >>> regulators of this device).
> >>>
> >>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >>> ---
> >>>  Documentation/devicetree/bindings/mfd/st,stpmic1.yaml | 10 ++++++++++
> >>>  1 file changed, 10 insertions(+)
> >>>
> >>> diff --git a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml
> >>> index 97c61097f9e2..1a1ced489ef7 100644
> >>> --- a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml
> >>> +++ b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml
> >>> @@ -189,6 +189,16 @@ properties:
> >>>  
> >>>        "^(buck[1-4]|ldo[1-6]|boost|vref_ddr|pwr_sw[1-2])$":
> >>>          $ref: ../regulator/regulator.yaml
> >>> +        unevaluatedProperties: false
> >>> +
> >>> +        properties:
> >>> +          interrupts:
> >>> +            maxItems: 1
> >>> +
> >>> +          st,mask-reset:
> >>> +            description: mask reset for this regulator, the regulator configuration
> >>> +              is maintained during pmic reset.
> >>> +            $ref: /schemas/types.yaml#/definitions/flag
> >>
> >> After further testing I see this patch is wrong. There are already
> >> buck[1-4] entries, so this is duplicating things. I will send v2.
> > 
> > Are you still planning on resending this set?
> > 
> 
> I already did and you took it. Email subject was different, though:

Understood, thanks for the clarification.

> https://lore.kernel.org/all/20230726065633.74924-1-krzysztof.kozlowski@linaro.org/
> Best regards,
> Krzysztof
>
  

Patch

diff --git a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml
index 97c61097f9e2..1a1ced489ef7 100644
--- a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml
+++ b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml
@@ -189,6 +189,16 @@  properties:
 
       "^(buck[1-4]|ldo[1-6]|boost|vref_ddr|pwr_sw[1-2])$":
         $ref: ../regulator/regulator.yaml
+        unevaluatedProperties: false
+
+        properties:
+          interrupts:
+            maxItems: 1
+
+          st,mask-reset:
+            description: mask reset for this regulator, the regulator configuration
+              is maintained during pmic reset.
+            $ref: /schemas/types.yaml#/definitions/flag
 
       "^ldo[1-2,5-6]$":
         type: object