diff mbox series

dt-bindings: at25: fix syntax error in example code

Message ID 20200727100505.23908-1-ceggers@arri.de
State Changes Requested, archived
Headers show
Series dt-bindings: at25: fix syntax error in example code | expand

Checks

Context Check Description
robh/checkpatch success

Commit Message

Christian Eggers July 27, 2020, 10:05 a.m. UTC
Add missing semicolon.

Signed-off-by: Christian Eggers <ceggers@arri.de>
---
 Documentation/devicetree/bindings/eeprom/at25.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Rob Herring July 27, 2020, 5:56 p.m. UTC | #1
On Mon, Jul 27, 2020 at 4:05 AM Christian Eggers <ceggers@arri.de> wrote:
>
> Add missing semicolon.
>
> Signed-off-by: Christian Eggers <ceggers@arri.de>
> ---
>  Documentation/devicetree/bindings/eeprom/at25.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

At this point, I'd prefer to see this converted to schema instead of
trivial fixes. Then the tooling will catch these syntax errors.

Rob
Christian Eggers July 28, 2020, 7:34 a.m. UTC | #2
On Monday, 27 July 2020, 19:56:59 CEST, Rob Herring wrote:
> On Mon, Jul 27, 2020 at 4:05 AM Christian Eggers <ceggers@arri.de> wrote:
> > Add missing semicolon.
> > 
> > Signed-off-by: Christian Eggers <ceggers@arri.de>
> > ---
> > 
> >  Documentation/devicetree/bindings/eeprom/at25.txt | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> At this point, I'd prefer to see this converted to schema instead of
> trivial fixes. Then the tooling will catch these syntax errors.
> 
While trying to convert the at25 binding to yaml, I ran into the following problem:

> Required properties:
> - compatible : Should be "<vendor>,<type>", and generic value "atmel,at25".
> 
>   Example "<vendor>,<type>" values:
>     "anvo,anv32e61w"
>     "microchip,25lc040"
>     "st,m95m02"
>     "st,m95256"

The current binding uses arbitrary values for the compatible string,
only "atmel,at25" is really known by the driver. All other hardware related
settings are provided as separate properties.

When I specify

  compatible:
    enum:
      - atmel,at25

I get an error in dt_binding_check:

Documentation/devicetree/bindings/eeprom/at25.example.dt.yaml: eeprom@0: compatible: Additional items are not allowed ('atmel,at25' was unexpected)
Documentation/devicetree/bindings/eeprom/at25.example.dt.yaml: eeprom@0: compatible:0: 'st,m95256' is not one of ['atmel,at25']
Documentation/devicetree/bindings/eeprom/at25.example.dt.yaml: eeprom@0: compatible: ['st,m95256', 'atmel,at25'] is too long

How to handle this correctly?

regards
Christian
Rob Herring July 31, 2020, 8:40 p.m. UTC | #3
On Tue, Jul 28, 2020 at 1:34 AM Christian Eggers <ceggers@arri.de> wrote:
>
> On Monday, 27 July 2020, 19:56:59 CEST, Rob Herring wrote:
> > On Mon, Jul 27, 2020 at 4:05 AM Christian Eggers <ceggers@arri.de> wrote:
> > > Add missing semicolon.
> > >
> > > Signed-off-by: Christian Eggers <ceggers@arri.de>
> > > ---
> > >
> > >  Documentation/devicetree/bindings/eeprom/at25.txt | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > At this point, I'd prefer to see this converted to schema instead of
> > trivial fixes. Then the tooling will catch these syntax errors.
> >
> While trying to convert the at25 binding to yaml, I ran into the following problem:
>
> > Required properties:
> > - compatible : Should be "<vendor>,<type>", and generic value "atmel,at25".
> >
> >   Example "<vendor>,<type>" values:
> >     "anvo,anv32e61w"
> >     "microchip,25lc040"
> >     "st,m95m02"
> >     "st,m95256"
>
> The current binding uses arbitrary values for the compatible string,
> only "atmel,at25" is really known by the driver. All other hardware related
> settings are provided as separate properties.
>
> When I specify
>
>   compatible:
>     enum:
>       - atmel,at25
>
> I get an error in dt_binding_check:
>
> Documentation/devicetree/bindings/eeprom/at25.example.dt.yaml: eeprom@0: compatible: Additional items are not allowed ('atmel,at25' was unexpected)
> Documentation/devicetree/bindings/eeprom/at25.example.dt.yaml: eeprom@0: compatible:0: 'st,m95256' is not one of ['atmel,at25']
> Documentation/devicetree/bindings/eeprom/at25.example.dt.yaml: eeprom@0: compatible: ['st,m95256', 'atmel,at25'] is too long
>
> How to handle this correctly?

You can do:

items:
  - {}
  - const: atmel,at25

But really, the possible compatible strings need to be listed out. See
at24.yaml as it had similar issues IIRC.

Rob
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/eeprom/at25.txt b/Documentation/devicetree/bindings/eeprom/at25.txt
index fcacd97abd0a..fe91ecf1f61b 100644
--- a/Documentation/devicetree/bindings/eeprom/at25.txt
+++ b/Documentation/devicetree/bindings/eeprom/at25.txt
@@ -33,7 +33,7 @@  Additional compatible properties are also allowed.
 Example:
 	eeprom@0 {
 		compatible = "st,m95256", "atmel,at25";
-		reg = <0>
+		reg = <0>;
 		spi-max-frequency = <5000000>;
 		spi-cpha;
 		spi-cpol;