mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: pinctrl: st,stm32: fix phandle-array warning
@ 2023-10-06  8:22 Martin Kaiser
  2023-10-06 17:56 ` Rob Herring
  2023-10-10 12:11 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Martin Kaiser @ 2023-10-06  8:22 UTC (permalink / raw)
  To: Linus Walleij, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Maxime Coquelin, Alexandre Torgue, Geert Uytterhoeven,
	Magnus Damm
  Cc: Martin Kaiser, linux-gpio, devicetree, linux-stm32,
	linux-arm-kernel, linux-kernel, linux-renesas-soc

make CHECK_DTBS=y st/stm32f469-disco.dtb

brings up a warning about a missing argument:

stm32f469-disco.dtb: pinctrl@40020000: st,syscfg:0: [21, 8] is too short

The description of the third entry indicates that this entry is optional.
The code in stm32_pctrl_dt_setup_irq parses st,syscfg and treats the third
entry as optional. It defaults to 0xf if not present in the devicetree.

Update the schema to require at least two entries, use the same syntax as
the description of renesas,ipmmu-main in
Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.yaml.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---

I tested the following cases, all of them returned the expected result:

   st,syscfg = <&syscfg>;              (too short)
   st,syscfg = <&syscfg 0x8>;          (ok)
   st,syscfg = <&syscfg 0x8 0x0>;      (ok)
   st,syscfg = <&syscfg 0x8 0x0 0x0>;  (too long)

 .../devicetree/bindings/pinctrl/st,stm32-pinctrl.yaml          | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.yaml
index 2120ef71a78d..e1eb45a9eda4 100644
--- a/Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.yaml
@@ -48,7 +48,8 @@ properties:
     description: Phandle+args to the syscon node which includes IRQ mux selection.
     $ref: /schemas/types.yaml#/definitions/phandle-array
     items:
-      - items:
+      - minItems: 2
+        items:
           - description: syscon node which includes IRQ mux selection
           - description: The offset of the IRQ mux selection register
           - description: The field mask of IRQ mux, needed if different of 0xf
-- 
2.39.2


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

* Re: [PATCH] dt-bindings: pinctrl: st,stm32: fix phandle-array warning
  2023-10-06  8:22 [PATCH] dt-bindings: pinctrl: st,stm32: fix phandle-array warning Martin Kaiser
@ 2023-10-06 17:56 ` Rob Herring
  2023-10-10 12:11 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Rob Herring @ 2023-10-06 17:56 UTC (permalink / raw)
  To: Martin Kaiser
  Cc: Alexandre Torgue, Rob Herring, Krzysztof Kozlowski, devicetree,
	linux-gpio, linux-stm32, Maxime Coquelin, linux-arm-kernel,
	Conor Dooley, Linus Walleij, Magnus Damm, linux-kernel,
	linux-renesas-soc, Geert Uytterhoeven


On Fri, 06 Oct 2023 10:22:48 +0200, Martin Kaiser wrote:
> make CHECK_DTBS=y st/stm32f469-disco.dtb
> 
> brings up a warning about a missing argument:
> 
> stm32f469-disco.dtb: pinctrl@40020000: st,syscfg:0: [21, 8] is too short
> 
> The description of the third entry indicates that this entry is optional.
> The code in stm32_pctrl_dt_setup_irq parses st,syscfg and treats the third
> entry as optional. It defaults to 0xf if not present in the devicetree.
> 
> Update the schema to require at least two entries, use the same syntax as
> the description of renesas,ipmmu-main in
> Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.yaml.
> 
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>
> ---
> 
> I tested the following cases, all of them returned the expected result:
> 
>    st,syscfg = <&syscfg>;              (too short)
>    st,syscfg = <&syscfg 0x8>;          (ok)
>    st,syscfg = <&syscfg 0x8 0x0>;      (ok)
>    st,syscfg = <&syscfg 0x8 0x0 0x0>;  (too long)
> 
>  .../devicetree/bindings/pinctrl/st,stm32-pinctrl.yaml          | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 

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


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

* Re: [PATCH] dt-bindings: pinctrl: st,stm32: fix phandle-array warning
  2023-10-06  8:22 [PATCH] dt-bindings: pinctrl: st,stm32: fix phandle-array warning Martin Kaiser
  2023-10-06 17:56 ` Rob Herring
@ 2023-10-10 12:11 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2023-10-10 12:11 UTC (permalink / raw)
  To: Martin Kaiser
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
	Alexandre Torgue, Geert Uytterhoeven, Magnus Damm, linux-gpio,
	devicetree, linux-stm32, linux-arm-kernel, linux-kernel,
	linux-renesas-soc

On Fri, Oct 6, 2023 at 10:27 AM Martin Kaiser <martin@kaiser.cx> wrote:


> make CHECK_DTBS=y st/stm32f469-disco.dtb
>
> brings up a warning about a missing argument:
>
> stm32f469-disco.dtb: pinctrl@40020000: st,syscfg:0: [21, 8] is too short
>
> The description of the third entry indicates that this entry is optional.
> The code in stm32_pctrl_dt_setup_irq parses st,syscfg and treats the third
> entry as optional. It defaults to 0xf if not present in the devicetree.
>
> Update the schema to require at least two entries, use the same syntax as
> the description of renesas,ipmmu-main in
> Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.yaml.
>
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>

Patch applied!

Yours,
Linus Walleij

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

end of thread, other threads:[~2023-10-10 12:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-06  8:22 [PATCH] dt-bindings: pinctrl: st,stm32: fix phandle-array warning Martin Kaiser
2023-10-06 17:56 ` Rob Herring
2023-10-10 12:11 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®