dt-bindings: mfd: x-powers,axp152: simplify disallowing properties

Message ID 20230325114353.50293-1-krzysztof.kozlowski@linaro.org
State New
Headers
Series dt-bindings: mfd: x-powers,axp152: simplify disallowing properties |

Commit Message

Krzysztof Kozlowski March 25, 2023, 11:43 a.m. UTC
  The syntax to disallow x-powers,drive-vbus-en,
x-powers,self-working-mode and x-powers,master-mode for certain variants
can be made simpler.  Also this produces much nicer warning message when
the condition hits wrong DTS.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

Cc: Andre Przywara <andre.przywara@arm.com>
---
 .../devicetree/bindings/mfd/x-powers,axp152.yaml | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)
  

Comments

Andre Przywara March 28, 2023, 2:03 p.m. UTC | #1
On Sat, 25 Mar 2023 12:43:53 +0100
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:

Hi,

> The syntax to disallow x-powers,drive-vbus-en,
> x-powers,self-working-mode and x-powers,master-mode for certain variants
> can be made simpler.  Also this produces much nicer warning message when
> the condition hits wrong DTS.

Ah, indeed, that reads much nicer!

> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Andre Przywara <andre.przywara@arm.com>

Cheers,
Andre

> ---
> 
> Cc: Andre Przywara <andre.przywara@arm.com>
> ---
>  .../devicetree/bindings/mfd/x-powers,axp152.yaml | 16 +++++-----------
>  1 file changed, 5 insertions(+), 11 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml b/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
> index 24d03996b93a..8eeb5b387430 100644
> --- a/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
> +++ b/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
> @@ -47,9 +47,8 @@ allOf:
>                - x-powers,axp209
>  
>      then:
> -      not:
> -        required:
> -          - x-powers,drive-vbus-en
> +      properties:
> +        x-powers,drive-vbus-en: false
>  
>    - if:
>        not:
> @@ -59,14 +58,9 @@ allOf:
>                const: x-powers,axp806
>  
>      then:
> -      allOf:
> -        - not:
> -            required:
> -              - x-powers,self-working-mode
> -
> -        - not:
> -            required:
> -              - x-powers,master-mode
> +      properties:
> +        x-powers,self-working-mode: false
> +        x-powers,master-mode: false
>  
>    - if:
>        not:
  
Chen-Yu Tsai March 28, 2023, 2:08 p.m. UTC | #2
On Tue, Mar 28, 2023 at 10:03 PM Andre Przywara <andre.przywara@arm.com> wrote:
>
> On Sat, 25 Mar 2023 12:43:53 +0100
> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:
>
> Hi,
>
> > The syntax to disallow x-powers,drive-vbus-en,
> > x-powers,self-working-mode and x-powers,master-mode for certain variants
> > can be made simpler.  Also this produces much nicer warning message when
> > the condition hits wrong DTS.
>
> Ah, indeed, that reads much nicer!
>
> > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>
> Reviewed-by: Andre Przywara <andre.przywara@arm.com>
> Tested-by: Andre Przywara <andre.przywara@arm.com>

Acked-by: Chen-Yu Tsai <wens@csie.org>
  
Lee Jones March 30, 2023, 1:33 p.m. UTC | #3
On Sat, 25 Mar 2023, Krzysztof Kozlowski wrote:

> The syntax to disallow x-powers,drive-vbus-en,
> x-powers,self-working-mode and x-powers,master-mode for certain variants
> can be made simpler.  Also this produces much nicer warning message when
> the condition hits wrong DTS.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Applied, thanks

--
Lee Jones [李琼斯]
  

Patch

diff --git a/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml b/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
index 24d03996b93a..8eeb5b387430 100644
--- a/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
+++ b/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
@@ -47,9 +47,8 @@  allOf:
               - x-powers,axp209
 
     then:
-      not:
-        required:
-          - x-powers,drive-vbus-en
+      properties:
+        x-powers,drive-vbus-en: false
 
   - if:
       not:
@@ -59,14 +58,9 @@  allOf:
               const: x-powers,axp806
 
     then:
-      allOf:
-        - not:
-            required:
-              - x-powers,self-working-mode
-
-        - not:
-            required:
-              - x-powers,master-mode
+      properties:
+        x-powers,self-working-mode: false
+        x-powers,master-mode: false
 
   - if:
       not: