All of lore.kernel.org
 help / color / mirror / Atom feed
* 'reg: property has invalid length' with new JSON-schema bindings
@ 2019-03-31  2:26 Brian Masney
  2019-03-31 10:39 ` Brian Masney
  0 siblings, 1 reply; 2+ messages in thread
From: Brian Masney @ 2019-03-31  2:26 UTC (permalink / raw)
  To: Rob Herring; +Cc: devicetree, linux-kernel

Hi Rob,

I'm finishing up a patch series that adds device tree support for a
backlight driver and I made the bindings use the new JSON schema. I'm
running into a problem with the reg property in the examples and I can
reproduce the issue by adding an example to the trivial bindings:

diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml
b/Documentation/devicetree/bindings/trivial-devices.yaml
index d79fb22bde39..bdab6a015db4 100644
--- a/Documentation/devicetree/bindings/trivial-devices.yaml
+++ b/Documentation/devicetree/bindings/trivial-devices.yaml
@@ -341,4 +341,10 @@ required:
   - compatible
   - reg
 
+examples:
+  - |
+    isl29028@38 {
+        compatible = "isil,isl29028";
+        reg = <0x38>;
+    };
 ...

'make dt_binding_check' fails with the following error:

  Documentation/devicetree/bindings/trivial-devices.example.dts:11.5-18:
    Warning (reg_format): /isl29028@38:reg: property has invalid length
    (4 bytes) (#address-cells == 1, #size-cells == 1)
  ...
  Documentation/devicetree/bindings/trivial-devices.example.dtb:
    Warning (i2c_bus_reg): Failed prerequisite 'reg_format'

I see that dt-extract-example hard codes those two cell values to 1:
https://github.com/robherring/yaml-bindings/blob/master/tools/dt-extract-example

The I2C buses for my board (qcom-msm8974) sets #size-cells to 0. Do you
have any suggestions for how I can correct this issue? I can make the
binding check happy by adding a length (reg = <0x38 0x4>;) but I assume
that we shouldn't do that for I2C addresses like this.

Brian

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

* Re: 'reg: property has invalid length' with new JSON-schema bindings
  2019-03-31  2:26 'reg: property has invalid length' with new JSON-schema bindings Brian Masney
@ 2019-03-31 10:39 ` Brian Masney
  0 siblings, 0 replies; 2+ messages in thread
From: Brian Masney @ 2019-03-31 10:39 UTC (permalink / raw)
  To: Rob Herring; +Cc: devicetree, linux-kernel

On Sat, Mar 30, 2019 at 10:26:53PM -0400, Brian Masney wrote:
> I'm finishing up a patch series that adds device tree support for a
> backlight driver and I made the bindings use the new JSON schema. I'm
> running into a problem with the reg property in the examples and I can
> reproduce the issue by adding an example to the trivial bindings:
> 
> diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml
> b/Documentation/devicetree/bindings/trivial-devices.yaml
> index d79fb22bde39..bdab6a015db4 100644
> --- a/Documentation/devicetree/bindings/trivial-devices.yaml
> +++ b/Documentation/devicetree/bindings/trivial-devices.yaml
> @@ -341,4 +341,10 @@ required:
>    - compatible
>    - reg
>  
> +examples:
> +  - |
> +    isl29028@38 {
> +        compatible = "isil,isl29028";
> +        reg = <0x38>;
> +    };
>  ...
> 
> 'make dt_binding_check' fails with the following error:
> 
>   Documentation/devicetree/bindings/trivial-devices.example.dts:11.5-18:
>     Warning (reg_format): /isl29028@38:reg: property has invalid length
>     (4 bytes) (#address-cells == 1, #size-cells == 1)
>   ...
>   Documentation/devicetree/bindings/trivial-devices.example.dtb:
>     Warning (i2c_bus_reg): Failed prerequisite 'reg_format'

I make the check happy by including an i2c node in my example.

examples:
  - |
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        isl29028@38 {
                compatible = "isil,isl29028";
                reg = <0x38>;
        };
    };

Sorry about the noise.

Brian

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

end of thread, other threads:[~2019-03-31 10:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-31  2:26 'reg: property has invalid length' with new JSON-schema bindings Brian Masney
2019-03-31 10:39 ` Brian Masney

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.