dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/3] dt-bindings: Fix errors in 'if' schemas
       [not found] <20210202205544.24812-1-robh@kernel.org>
@ 2021-02-02 20:55 ` Rob Herring
  2021-02-03  8:01   ` Geert Uytterhoeven
                     ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Rob Herring @ 2021-02-02 20:55 UTC (permalink / raw)
  To: devicetree
  Cc: Ulf Hansson, Tomer Maimon, Geert Uytterhoeven, Andrew Jeffery,
	Vincent Cheng, dri-devel, Tali Perry, Daniel Palmer, linux-i2c,
	Pavel Machek, Will Deacon, linux-clk, linux-leds,
	Florian Fainelli, Herbert Xu, Joerg Roedel, Daniel Lezcano,
	Vinod Koul, Kishon Vijay Abraham I, Bartosz Golaszewski,
	Chen-Yu Tsai, Joel Stanley, Guenter Roeck, linux-watchdog,
	Ray Jui, linux-gpio, Wim Van Sebroeck, Scott Branden,
	Avi Fishman, Yoshihiro Shimoda, linux-mmc, linux-kernel,
	Stephen Boyd, iommu, linux-crypto, David S. Miller,
	Nicolas Saenz Julienne

Properties in if/then schemas weren't getting checked by the meta-schemas.
Enabling meta-schema checks finds several errors.

The use of an 'items' schema (as opposed to the list form) is wrong in
some cases as it applies to all entries. 'contains' is the correct schema
to use in the case of multiple entries.

Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Chen-Yu Tsai <wens@csie.org>
Cc: Eric Anholt <eric@anholt.net>
Cc: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Ray Jui <rjui@broadcom.com>
Cc: Scott Branden <sbranden@broadcom.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Vinod Koul <vkoul@kernel.org>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: linux-crypto@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-leds@vger.kernel.org
Cc: linux-mmc@vger.kernel.org
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
 .../devicetree/bindings/crypto/allwinner,sun8i-ce.yaml   | 3 +--
 .../devicetree/bindings/display/brcm,bcm2835-hvs.yaml    | 2 +-
 Documentation/devicetree/bindings/leds/ti,tca6507.yaml   | 1 +
 Documentation/devicetree/bindings/mmc/renesas,sdhi.yaml  | 2 +-
 Documentation/devicetree/bindings/phy/brcm,sata-phy.yaml | 3 +--
 .../devicetree/bindings/phy/renesas,usb2-phy.yaml        | 5 ++---
 .../devicetree/bindings/pinctrl/renesas,pfc.yaml         | 9 ++++-----
 .../bindings/timer/allwinner,sun5i-a13-hstimer.yaml      | 3 +--
 8 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/Documentation/devicetree/bindings/crypto/allwinner,sun8i-ce.yaml b/Documentation/devicetree/bindings/crypto/allwinner,sun8i-ce.yaml
index 7a60d84289cc..6ab07eba7778 100644
--- a/Documentation/devicetree/bindings/crypto/allwinner,sun8i-ce.yaml
+++ b/Documentation/devicetree/bindings/crypto/allwinner,sun8i-ce.yaml
@@ -46,8 +46,7 @@ properties:
 if:
   properties:
     compatible:
-      items:
-        const: allwinner,sun50i-h6-crypto
+      const: allwinner,sun50i-h6-crypto
 then:
   properties:
     clocks:
diff --git a/Documentation/devicetree/bindings/display/brcm,bcm2835-hvs.yaml b/Documentation/devicetree/bindings/display/brcm,bcm2835-hvs.yaml
index e826ab0adb75..2e8566f47e63 100644
--- a/Documentation/devicetree/bindings/display/brcm,bcm2835-hvs.yaml
+++ b/Documentation/devicetree/bindings/display/brcm,bcm2835-hvs.yaml
@@ -36,7 +36,7 @@ if:
   properties:
     compatible:
       contains:
-        const: brcm,bcm2711-hvs"
+        const: brcm,bcm2711-hvs
 
 then:
   required:
diff --git a/Documentation/devicetree/bindings/leds/ti,tca6507.yaml b/Documentation/devicetree/bindings/leds/ti,tca6507.yaml
index 94c307c98762..32c600387895 100644
--- a/Documentation/devicetree/bindings/leds/ti,tca6507.yaml
+++ b/Documentation/devicetree/bindings/leds/ti,tca6507.yaml
@@ -69,6 +69,7 @@ patternProperties:
 if:
   patternProperties:
     "^gpio@[0-6]$":
+      type: object
       properties:
         compatible:
           contains:
diff --git a/Documentation/devicetree/bindings/mmc/renesas,sdhi.yaml b/Documentation/devicetree/bindings/mmc/renesas,sdhi.yaml
index 6bbf29b5c239..6c13703b31db 100644
--- a/Documentation/devicetree/bindings/mmc/renesas,sdhi.yaml
+++ b/Documentation/devicetree/bindings/mmc/renesas,sdhi.yaml
@@ -123,7 +123,7 @@ required:
 if:
   properties:
     compatible:
-      items:
+      contains:
         enum:
           - renesas,sdhi-r7s72100
           - renesas,sdhi-r7s9210
diff --git a/Documentation/devicetree/bindings/phy/brcm,sata-phy.yaml b/Documentation/devicetree/bindings/phy/brcm,sata-phy.yaml
index 58c3ef8004ad..04edda504ab6 100644
--- a/Documentation/devicetree/bindings/phy/brcm,sata-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/brcm,sata-phy.yaml
@@ -99,8 +99,7 @@ patternProperties:
 if:
   properties:
     compatible:
-      items:
-        const: brcm,iproc-ns2-sata-phy
+      const: brcm,iproc-ns2-sata-phy
 then:
   properties:
     reg:
diff --git a/Documentation/devicetree/bindings/phy/renesas,usb2-phy.yaml b/Documentation/devicetree/bindings/phy/renesas,usb2-phy.yaml
index 829e8c7e467a..0f358d5b84ef 100644
--- a/Documentation/devicetree/bindings/phy/renesas,usb2-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/renesas,usb2-phy.yaml
@@ -81,9 +81,8 @@ properties:
 if:
   properties:
     compatible:
-      items:
-        enum:
-          - renesas,usb2-phy-r7s9210
+      contains:
+        const: renesas,usb2-phy-r7s9210
 then:
   required:
     - clock-names
diff --git a/Documentation/devicetree/bindings/pinctrl/renesas,pfc.yaml b/Documentation/devicetree/bindings/pinctrl/renesas,pfc.yaml
index 5b5b1b9d2ec7..5d3947902f2d 100644
--- a/Documentation/devicetree/bindings/pinctrl/renesas,pfc.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/renesas,pfc.yaml
@@ -76,11 +76,10 @@ required:
 if:
   properties:
     compatible:
-      items:
-        enum:
-          - renesas,pfc-r8a73a4
-          - renesas,pfc-r8a7740
-          - renesas,pfc-sh73a0
+      enum:
+        - renesas,pfc-r8a73a4
+        - renesas,pfc-r8a7740
+        - renesas,pfc-sh73a0
 then:
   required:
     - interrupts-extended
diff --git a/Documentation/devicetree/bindings/timer/allwinner,sun5i-a13-hstimer.yaml b/Documentation/devicetree/bindings/timer/allwinner,sun5i-a13-hstimer.yaml
index 40fc4bcb3145..b6a6d03a08b2 100644
--- a/Documentation/devicetree/bindings/timer/allwinner,sun5i-a13-hstimer.yaml
+++ b/Documentation/devicetree/bindings/timer/allwinner,sun5i-a13-hstimer.yaml
@@ -46,8 +46,7 @@ required:
 if:
   properties:
     compatible:
-      items:
-        const: allwinner,sun5i-a13-hstimer
+      const: allwinner,sun5i-a13-hstimer
 
 then:
   properties:
-- 
2.27.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/3] dt-bindings: Fix errors in 'if' schemas
  2021-02-02 20:55 ` [PATCH 3/3] dt-bindings: Fix errors in 'if' schemas Rob Herring
@ 2021-02-03  8:01   ` Geert Uytterhoeven
  2021-02-03 15:55     ` Rob Herring
  2021-02-03  8:22   ` Maxime Ripard
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2021-02-03  8:01 UTC (permalink / raw)
  To: Rob Herring
  Cc: Ulf Hansson, Tomer Maimon, Geert Uytterhoeven, Vincent Cheng,
	DRI Development, Tali Perry, Daniel Palmer, Linux I2C,
	Pavel Machek, Will Deacon, linux-clk, linux-leds,
	Florian Fainelli, Herbert Xu, Joerg Roedel, Daniel Lezcano,
	Vinod Koul, Kishon Vijay Abraham I, Bartosz Golaszewski,
	Chen-Yu Tsai, Joel Stanley, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux Watchdog Mailing List, Ray Jui, open list:GPIO SUBSYSTEM,
	Wim Van Sebroeck, Avi Fishman, Scott Branden, Stephen Boyd,
	Yoshihiro Shimoda, Linux MMC List, Linux Kernel Mailing List,
	Andrew Jeffery, Linux IOMMU, Linux Crypto Mailing List,
	David S. Miller, Nicolas Saenz Julienne

Hi Rob,

On Tue, Feb 2, 2021 at 9:55 PM Rob Herring <robh@kernel.org> wrote:
> Properties in if/then schemas weren't getting checked by the meta-schemas.
> Enabling meta-schema checks finds several errors.
>
> The use of an 'items' schema (as opposed to the list form) is wrong in
> some cases as it applies to all entries. 'contains' is the correct schema
> to use in the case of multiple entries.

> Signed-off-by: Rob Herring <robh@kernel.org>

Thanks for your patch!

> --- a/Documentation/devicetree/bindings/phy/renesas,usb2-phy.yaml
> +++ b/Documentation/devicetree/bindings/phy/renesas,usb2-phy.yaml
> @@ -81,9 +81,8 @@ properties:
>  if:
>    properties:
>      compatible:
> -      items:
> -        enum:
> -          - renesas,usb2-phy-r7s9210
> +      contains:
> +        const: renesas,usb2-phy-r7s9210

Single entry, so "contains" not needed?

> --- a/Documentation/devicetree/bindings/pinctrl/renesas,pfc.yaml
> +++ b/Documentation/devicetree/bindings/pinctrl/renesas,pfc.yaml
> @@ -76,11 +76,10 @@ required:
>  if:
>    properties:
>      compatible:
> -      items:
> -        enum:
> -          - renesas,pfc-r8a73a4
> -          - renesas,pfc-r8a7740
> -          - renesas,pfc-sh73a0
> +      enum:
> +        - renesas,pfc-r8a73a4
> +        - renesas,pfc-r8a7740
> +        - renesas,pfc-sh73a0

Missing "contains"?

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/3] dt-bindings: Fix errors in 'if' schemas
  2021-02-02 20:55 ` [PATCH 3/3] dt-bindings: Fix errors in 'if' schemas Rob Herring
  2021-02-03  8:01   ` Geert Uytterhoeven
@ 2021-02-03  8:22   ` Maxime Ripard
  2021-02-03 11:22   ` Vinod Koul
  2021-02-03 11:55   ` Nicolas Saenz Julienne
  3 siblings, 0 replies; 7+ messages in thread
From: Maxime Ripard @ 2021-02-03  8:22 UTC (permalink / raw)
  To: Rob Herring
  Cc: Ulf Hansson, Tomer Maimon, Geert Uytterhoeven, Vincent Cheng,
	dri-devel, Tali Perry, Daniel Palmer, linux-i2c, Pavel Machek,
	Will Deacon, linux-clk, linux-leds, Florian Fainelli, Herbert Xu,
	Joerg Roedel, Daniel Lezcano, Vinod Koul, Kishon Vijay Abraham I,
	Bartosz Golaszewski, Chen-Yu Tsai, Joel Stanley, Guenter Roeck,
	devicetree, linux-watchdog, Ray Jui, linux-gpio,
	Wim Van Sebroeck, Avi Fishman, Scott Branden, Stephen Boyd,
	Yoshihiro Shimoda, linux-mmc, linux-kernel, Andrew Jeffery,
	iommu, linux-crypto, David S. Miller, Nicolas Saenz Julienne


[-- Attachment #1.1: Type: text/plain, Size: 1381 bytes --]

On Tue, Feb 02, 2021 at 02:55:44PM -0600, Rob Herring wrote:
> Properties in if/then schemas weren't getting checked by the meta-schemas.
> Enabling meta-schema checks finds several errors.
> 
> The use of an 'items' schema (as opposed to the list form) is wrong in
> some cases as it applies to all entries. 'contains' is the correct schema
> to use in the case of multiple entries.
> 
> Cc: Herbert Xu <herbert@gondor.apana.org.au>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Chen-Yu Tsai <wens@csie.org>
> Cc: Eric Anholt <eric@anholt.net>
> Cc: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
> Cc: Florian Fainelli <f.fainelli@gmail.com>
> Cc: Ray Jui <rjui@broadcom.com>
> Cc: Scott Branden <sbranden@broadcom.com>
> Cc: Pavel Machek <pavel@ucw.cz>
> Cc: Ulf Hansson <ulf.hansson@linaro.org>
> Cc: Kishon Vijay Abraham I <kishon@ti.com>
> Cc: Vinod Koul <vkoul@kernel.org>
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> Cc: linux-crypto@vger.kernel.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-leds@vger.kernel.org
> Cc: linux-mmc@vger.kernel.org
> Cc: linux-gpio@vger.kernel.org
> Signed-off-by: Rob Herring <robh@kernel.org>

Acked-by: Maxime Ripard <mripard@kernel.org>

Maxime

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/3] dt-bindings: Fix errors in 'if' schemas
  2021-02-02 20:55 ` [PATCH 3/3] dt-bindings: Fix errors in 'if' schemas Rob Herring
  2021-02-03  8:01   ` Geert Uytterhoeven
  2021-02-03  8:22   ` Maxime Ripard
@ 2021-02-03 11:22   ` Vinod Koul
  2021-02-03 11:55   ` Nicolas Saenz Julienne
  3 siblings, 0 replies; 7+ messages in thread
From: Vinod Koul @ 2021-02-03 11:22 UTC (permalink / raw)
  To: Rob Herring
  Cc: Ulf Hansson, Tomer Maimon, Geert Uytterhoeven, Vincent Cheng,
	dri-devel, Tali Perry, Daniel Palmer, linux-i2c, Pavel Machek,
	Will Deacon, linux-clk, linux-leds, Florian Fainelli, Herbert Xu,
	Joerg Roedel, Daniel Lezcano, Kishon Vijay Abraham I,
	Bartosz Golaszewski, Chen-Yu Tsai, Joel Stanley, Guenter Roeck,
	devicetree, linux-watchdog, Ray Jui, linux-gpio,
	Wim Van Sebroeck, Avi Fishman, Scott Branden, Stephen Boyd,
	Yoshihiro Shimoda, linux-mmc, linux-kernel, Andrew Jeffery,
	iommu, linux-crypto, David S. Miller, Nicolas Saenz Julienne

On 02-02-21, 14:55, Rob Herring wrote:
> Properties in if/then schemas weren't getting checked by the meta-schemas.
> Enabling meta-schema checks finds several errors.
> 
> The use of an 'items' schema (as opposed to the list form) is wrong in
> some cases as it applies to all entries. 'contains' is the correct schema
> to use in the case of multiple entries.
> 
> Cc: Herbert Xu <herbert@gondor.apana.org.au>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Chen-Yu Tsai <wens@csie.org>
> Cc: Eric Anholt <eric@anholt.net>
> Cc: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
> Cc: Florian Fainelli <f.fainelli@gmail.com>
> Cc: Ray Jui <rjui@broadcom.com>
> Cc: Scott Branden <sbranden@broadcom.com>
> Cc: Pavel Machek <pavel@ucw.cz>
> Cc: Ulf Hansson <ulf.hansson@linaro.org>
> Cc: Kishon Vijay Abraham I <kishon@ti.com>
> Cc: Vinod Koul <vkoul@kernel.org>
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> Cc: linux-crypto@vger.kernel.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-leds@vger.kernel.org
> Cc: linux-mmc@vger.kernel.org
> Cc: linux-gpio@vger.kernel.org
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  .../devicetree/bindings/crypto/allwinner,sun8i-ce.yaml   | 3 +--
>  .../devicetree/bindings/display/brcm,bcm2835-hvs.yaml    | 2 +-
>  Documentation/devicetree/bindings/leds/ti,tca6507.yaml   | 1 +
>  Documentation/devicetree/bindings/mmc/renesas,sdhi.yaml  | 2 +-
>  Documentation/devicetree/bindings/phy/brcm,sata-phy.yaml | 3 +--
>  .../devicetree/bindings/phy/renesas,usb2-phy.yaml        | 5 ++---

For phy:

Acked-By: Vinod Koul <vkoul@kernel.org>

-- 
~Vinod
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/3] dt-bindings: Fix errors in 'if' schemas
  2021-02-02 20:55 ` [PATCH 3/3] dt-bindings: Fix errors in 'if' schemas Rob Herring
                     ` (2 preceding siblings ...)
  2021-02-03 11:22   ` Vinod Koul
@ 2021-02-03 11:55   ` Nicolas Saenz Julienne
  3 siblings, 0 replies; 7+ messages in thread
From: Nicolas Saenz Julienne @ 2021-02-03 11:55 UTC (permalink / raw)
  To: Rob Herring, devicetree
  Cc: Ulf Hansson, Tomer Maimon, Geert Uytterhoeven, Andrew Jeffery,
	Vincent Cheng, dri-devel, Tali Perry, Daniel Palmer, linux-i2c,
	Pavel Machek, Will Deacon, linux-clk, linux-leds,
	Florian Fainelli, Herbert Xu, Joerg Roedel, Daniel Lezcano,
	Vinod Koul, Kishon Vijay Abraham I, Bartosz Golaszewski,
	Chen-Yu Tsai, Joel Stanley, Guenter Roeck, linux-watchdog,
	Ray Jui, linux-gpio, Wim Van Sebroeck, Scott Branden,
	Avi Fishman, Yoshihiro Shimoda, linux-mmc, linux-kernel,
	Stephen Boyd, iommu, linux-crypto, David S. Miller


[-- Attachment #1.1: Type: text/plain, Size: 1389 bytes --]

On Tue, 2021-02-02 at 14:55 -0600, Rob Herring wrote:
> Properties in if/then schemas weren't getting checked by the meta-schemas.
> Enabling meta-schema checks finds several errors.
> 
> The use of an 'items' schema (as opposed to the list form) is wrong in
> some cases as it applies to all entries. 'contains' is the correct schema
> to use in the case of multiple entries.
> 
> Cc: Herbert Xu <herbert@gondor.apana.org.au>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Chen-Yu Tsai <wens@csie.org>
> Cc: Eric Anholt <eric@anholt.net>
> Cc: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
> Cc: Florian Fainelli <f.fainelli@gmail.com>
> Cc: Ray Jui <rjui@broadcom.com>
> Cc: Scott Branden <sbranden@broadcom.com>
> Cc: Pavel Machek <pavel@ucw.cz>
> Cc: Ulf Hansson <ulf.hansson@linaro.org>
> Cc: Kishon Vijay Abraham I <kishon@ti.com>
> Cc: Vinod Koul <vkoul@kernel.org>
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> Cc: linux-crypto@vger.kernel.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-leds@vger.kernel.org
> Cc: linux-mmc@vger.kernel.org
> Cc: linux-gpio@vger.kernel.org
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---

Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/3] dt-bindings: Fix errors in 'if' schemas
  2021-02-03  8:01   ` Geert Uytterhoeven
@ 2021-02-03 15:55     ` Rob Herring
  2021-02-03 16:02       ` Geert Uytterhoeven
  0 siblings, 1 reply; 7+ messages in thread
From: Rob Herring @ 2021-02-03 15:55 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Ulf Hansson, Tomer Maimon, Geert Uytterhoeven, Vincent Cheng,
	DRI Development, Tali Perry, Daniel Palmer, Linux I2C,
	Pavel Machek, Will Deacon, linux-clk, linux-leds,
	Florian Fainelli, Herbert Xu, Joerg Roedel, Daniel Lezcano,
	Vinod Koul, Kishon Vijay Abraham I, Bartosz Golaszewski,
	Chen-Yu Tsai, Joel Stanley, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux Watchdog Mailing List, Ray Jui, open list:GPIO SUBSYSTEM,
	Wim Van Sebroeck, Avi Fishman, Scott Branden, Stephen Boyd,
	Yoshihiro Shimoda, Linux MMC List, Linux Kernel Mailing List,
	Andrew Jeffery, Linux IOMMU, Linux Crypto Mailing List,
	David S. Miller, Nicolas Saenz Julienne

On Wed, Feb 03, 2021 at 09:01:23AM +0100, Geert Uytterhoeven wrote:
> Hi Rob,
> 
> On Tue, Feb 2, 2021 at 9:55 PM Rob Herring <robh@kernel.org> wrote:
> > Properties in if/then schemas weren't getting checked by the meta-schemas.
> > Enabling meta-schema checks finds several errors.
> >
> > The use of an 'items' schema (as opposed to the list form) is wrong in
> > some cases as it applies to all entries. 'contains' is the correct schema
> > to use in the case of multiple entries.
> 
> > Signed-off-by: Rob Herring <robh@kernel.org>
> 
> Thanks for your patch!
> 
> > --- a/Documentation/devicetree/bindings/phy/renesas,usb2-phy.yaml
> > +++ b/Documentation/devicetree/bindings/phy/renesas,usb2-phy.yaml
> > @@ -81,9 +81,8 @@ properties:
> >  if:
> >    properties:
> >      compatible:
> > -      items:
> > -        enum:
> > -          - renesas,usb2-phy-r7s9210
> > +      contains:
> > +        const: renesas,usb2-phy-r7s9210
> 
> Single entry, so "contains" not needed?

No, you are misunderstanding how these work. 'contains' means at least 
one entry in an array passes with the subschema. In this case, 
'renesas,usb2-phy-r7s9210' must appear somewhere in the 'compatible' 
values. (Before, it said *every* entry must be 
'renesas,usb2-phy-r7s9210'.) As there is a fallback compatible, we need 
'contains'.

> > --- a/Documentation/devicetree/bindings/pinctrl/renesas,pfc.yaml
> > +++ b/Documentation/devicetree/bindings/pinctrl/renesas,pfc.yaml
> > @@ -76,11 +76,10 @@ required:
> >  if:
> >    properties:
> >      compatible:
> > -      items:
> > -        enum:
> > -          - renesas,pfc-r8a73a4
> > -          - renesas,pfc-r8a7740
> > -          - renesas,pfc-sh73a0
> > +      enum:
> > +        - renesas,pfc-r8a73a4
> > +        - renesas,pfc-r8a7740
> > +        - renesas,pfc-sh73a0
> 
> Missing "contains"?

No. In this case, 'compatible' is always a single entry, so no 
'contains' needed (but would work). If compatible is one of these 3 
strings, then the 'if' is true.

The original way would actually work in this case (i.e. is valid 
json-schema), but we require 'items' to have a size (maxItems/minItems) 
in our meta-schema.

Rob
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/3] dt-bindings: Fix errors in 'if' schemas
  2021-02-03 15:55     ` Rob Herring
@ 2021-02-03 16:02       ` Geert Uytterhoeven
  0 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2021-02-03 16:02 UTC (permalink / raw)
  To: Rob Herring
  Cc: Ulf Hansson, Tomer Maimon, Geert Uytterhoeven, Vincent Cheng,
	DRI Development, Tali Perry, Daniel Palmer, Linux I2C,
	Pavel Machek, Will Deacon, linux-clk, linux-leds,
	Florian Fainelli, Herbert Xu, Joerg Roedel, Daniel Lezcano,
	Vinod Koul, Kishon Vijay Abraham I, Bartosz Golaszewski,
	Chen-Yu Tsai, Joel Stanley, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux Watchdog Mailing List, Ray Jui, open list:GPIO SUBSYSTEM,
	Wim Van Sebroeck, Avi Fishman, Scott Branden, Stephen Boyd,
	Yoshihiro Shimoda, Linux MMC List, Linux Kernel Mailing List,
	Andrew Jeffery, Linux IOMMU, Linux Crypto Mailing List,
	David S. Miller, Nicolas Saenz Julienne

Hi Rob,

On Wed, Feb 3, 2021 at 4:55 PM Rob Herring <robh@kernel.org> wrote:
> On Wed, Feb 03, 2021 at 09:01:23AM +0100, Geert Uytterhoeven wrote:
> > On Tue, Feb 2, 2021 at 9:55 PM Rob Herring <robh@kernel.org> wrote:
> > > Properties in if/then schemas weren't getting checked by the meta-schemas.
> > > Enabling meta-schema checks finds several errors.
> > >
> > > The use of an 'items' schema (as opposed to the list form) is wrong in
> > > some cases as it applies to all entries. 'contains' is the correct schema
> > > to use in the case of multiple entries.
> >
> > > Signed-off-by: Rob Herring <robh@kernel.org>
> >
> > Thanks for your patch!
> >
> > > --- a/Documentation/devicetree/bindings/phy/renesas,usb2-phy.yaml
> > > +++ b/Documentation/devicetree/bindings/phy/renesas,usb2-phy.yaml
> > > @@ -81,9 +81,8 @@ properties:
> > >  if:
> > >    properties:
> > >      compatible:
> > > -      items:
> > > -        enum:
> > > -          - renesas,usb2-phy-r7s9210
> > > +      contains:
> > > +        const: renesas,usb2-phy-r7s9210
> >
> > Single entry, so "contains" not needed?
>
> No, you are misunderstanding how these work. 'contains' means at least
> one entry in an array passes with the subschema. In this case,
> 'renesas,usb2-phy-r7s9210' must appear somewhere in the 'compatible'
> values. (Before, it said *every* entry must be
> 'renesas,usb2-phy-r7s9210'.) As there is a fallback compatible, we need
> 'contains'.
>
> > > --- a/Documentation/devicetree/bindings/pinctrl/renesas,pfc.yaml
> > > +++ b/Documentation/devicetree/bindings/pinctrl/renesas,pfc.yaml
> > > @@ -76,11 +76,10 @@ required:
> > >  if:
> > >    properties:
> > >      compatible:
> > > -      items:
> > > -        enum:
> > > -          - renesas,pfc-r8a73a4
> > > -          - renesas,pfc-r8a7740
> > > -          - renesas,pfc-sh73a0
> > > +      enum:
> > > +        - renesas,pfc-r8a73a4
> > > +        - renesas,pfc-r8a7740
> > > +        - renesas,pfc-sh73a0
> >
> > Missing "contains"?
>
> No. In this case, 'compatible' is always a single entry, so no
> 'contains' needed (but would work). If compatible is one of these 3
> strings, then the 'if' is true.
>
> The original way would actually work in this case (i.e. is valid
> json-schema), but we require 'items' to have a size (maxItems/minItems)
> in our meta-schema.

Thanks for the explanation!
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-02-04  8:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20210202205544.24812-1-robh@kernel.org>
2021-02-02 20:55 ` [PATCH 3/3] dt-bindings: Fix errors in 'if' schemas Rob Herring
2021-02-03  8:01   ` Geert Uytterhoeven
2021-02-03 15:55     ` Rob Herring
2021-02-03 16:02       ` Geert Uytterhoeven
2021-02-03  8:22   ` Maxime Ripard
2021-02-03 11:22   ` Vinod Koul
2021-02-03 11:55   ` Nicolas Saenz Julienne

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).