2023-06-19 10:35:24

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH] dt-bindings: mfd: samsung,s5m8767: Simplify excluding properties

Mutually exclusive s5m8767,pmic-buck[234]-uses-gpio-dvs properties can
be written simpler, with half of the lines of code.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
.../bindings/mfd/samsung,s5m8767.yaml | 25 ++++++-------------
1 file changed, 7 insertions(+), 18 deletions(-)

diff --git a/Documentation/devicetree/bindings/mfd/samsung,s5m8767.yaml b/Documentation/devicetree/bindings/mfd/samsung,s5m8767.yaml
index 10c7b408f33a..aea0b7d57d04 100644
--- a/Documentation/devicetree/bindings/mfd/samsung,s5m8767.yaml
+++ b/Documentation/devicetree/bindings/mfd/samsung,s5m8767.yaml
@@ -153,29 +153,18 @@ dependencies:
additionalProperties: false

allOf:
- - if:
+ - not:
required:
- s5m8767,pmic-buck2-uses-gpio-dvs
- then:
- properties:
- s5m8767,pmic-buck3-uses-gpio-dvs: false
- s5m8767,pmic-buck4-uses-gpio-dvs: false
-
- - if:
+ - s5m8767,pmic-buck3-uses-gpio-dvs
+ - not:
+ required:
+ - s5m8767,pmic-buck2-uses-gpio-dvs
+ - s5m8767,pmic-buck4-uses-gpio-dvs
+ - not:
required:
- s5m8767,pmic-buck3-uses-gpio-dvs
- then:
- properties:
- s5m8767,pmic-buck2-uses-gpio-dvs: false
- s5m8767,pmic-buck4-uses-gpio-dvs: false
-
- - if:
- required:
- s5m8767,pmic-buck4-uses-gpio-dvs
- then:
- properties:
- s5m8767,pmic-buck2-uses-gpio-dvs: false
- s5m8767,pmic-buck3-uses-gpio-dvs: false

examples:
- |
--
2.34.1



2023-06-19 21:26:48

by Conor Dooley

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: mfd: samsung,s5m8767: Simplify excluding properties

On Mon, Jun 19, 2023 at 12:14:24PM +0200, Krzysztof Kozlowski wrote:
> Mutually exclusive s5m8767,pmic-buck[234]-uses-gpio-dvs properties can
> be written simpler, with half of the lines of code.
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>

Acked-by: Conor Dooley <[email protected]>

Cheers,
Conor.


Attachments:
(No filename) (348.00 B)
signature.asc (235.00 B)
Download all attachments

2023-06-21 18:03:24

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: mfd: samsung,s5m8767: Simplify excluding properties

On Mon, 19 Jun 2023, Krzysztof Kozlowski wrote:

> Mutually exclusive s5m8767,pmic-buck[234]-uses-gpio-dvs properties can
> be written simpler, with half of the lines of code.
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
> ---
> .../bindings/mfd/samsung,s5m8767.yaml | 25 ++++++-------------
> 1 file changed, 7 insertions(+), 18 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]