diff mbox series

dt-bindings: restrict properties for sitronix,st7735r

Message ID 20200120190249.GA9619@ravnborg.org (mailing list archive)
State Mainlined
Commit c2d4290ba0fff0aad5bc491af18adfbc88bf1c8c
Delegated to: Kieran Bingham
Headers show
Series dt-bindings: restrict properties for sitronix,st7735r | expand

Commit Message

Sam Ravnborg Jan. 20, 2020, 7:02 p.m. UTC
Hi David.

> > +allOf:
> > +  - $ref: panel/panel-common.yaml#
> 
> not all of these properties are applicable.
> 

> > +required:
> > +  - compatible
> > +  - reg
> > +  - dc-gpios
> > +  - reset-gpios
> 
> Missing optional rotation and backlight properties.

Thanks for catching this. I have written a little .yaml files
since I applied this - and learned a little more of the syntax.

See attached patch for my attempt to fix this.
Please review.

	Sam

From 6b54fb0a071c0732cd4bd5b88f456b5a85bcf4f2 Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <sam@ravnborg.org>
Date: Mon, 20 Jan 2020 19:55:04 +0100
Subject: [PATCH] dt-bindings: restrict properties for sitronix,st7735r

David Lechner noticed (paraphrased):
- not all properties from panel-common are applicable.
- missing optional rotation and backlight properties

Fix this by listing all allowed properties, and do not allow other properties.

Fixes: abdd9e3705c8 ("dt-bindings: display: sitronix,st7735r: Convert to DT schema")
Reported-by: David Lechner <david@lechnology.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: David Lechner <david@lechnology.com>
Cc: Rob Herring <robh@kernel.org>
Cc: dri-devel@lists.freedesktop.org
---
 .../devicetree/bindings/display/sitronix,st7735r.yaml      | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Sam Ravnborg Jan. 23, 2020, 7:24 a.m. UTC | #1
On Mon, Jan 20, 2020 at 08:02:49PM +0100, Sam Ravnborg wrote:
> Hi David.
> 
> > > +allOf:
> > > +  - $ref: panel/panel-common.yaml#
> > 
> > not all of these properties are applicable.
> > 
> 
> > > +required:
> > > +  - compatible
> > > +  - reg
> > > +  - dc-gpios
> > > +  - reset-gpios
> > 
> > Missing optional rotation and backlight properties.
> 
> Thanks for catching this. I have written a little .yaml files
> since I applied this - and learned a little more of the syntax.
> 
> See attached patch for my attempt to fix this.
> Please review.

Hi David, Geert.

Any feedback on this patch?

	Sam

> 
> 	Sam
> 
> >From 6b54fb0a071c0732cd4bd5b88f456b5a85bcf4f2 Mon Sep 17 00:00:00 2001
> From: Sam Ravnborg <sam@ravnborg.org>
> Date: Mon, 20 Jan 2020 19:55:04 +0100
> Subject: [PATCH] dt-bindings: restrict properties for sitronix,st7735r
> 
> David Lechner noticed (paraphrased):
> - not all properties from panel-common are applicable.
> - missing optional rotation and backlight properties
> 
> Fix this by listing all allowed properties, and do not allow other properties.
> 
> Fixes: abdd9e3705c8 ("dt-bindings: display: sitronix,st7735r: Convert to DT schema")
> Reported-by: David Lechner <david@lechnology.com>
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: David Lechner <david@lechnology.com>
> Cc: Rob Herring <robh@kernel.org>
> Cc: dri-devel@lists.freedesktop.org
> ---
>  .../devicetree/bindings/display/sitronix,st7735r.yaml      | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml b/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml
> index 8892d79e6e10..0cebaaefda03 100644
> --- a/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml
> +++ b/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml
> @@ -39,12 +39,19 @@ properties:
>      maxItems: 1
>      description: Display data/command selection (D/CX)
>  
> +  backlight: true
> +  reg: true
> +  reset-gpios: true
> +  rotation: true
> +
>  required:
>    - compatible
>    - reg
>    - dc-gpios
>    - reset-gpios
>  
> +additionalProperties: false
> +
>  examples:
>    - |
>      #include <dt-bindings/gpio/gpio.h>
> -- 
> 2.20.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Geert Uytterhoeven Jan. 23, 2020, 7:43 a.m. UTC | #2
Hi Sam,

On Mon, Jan 20, 2020 at 8:02 PM Sam Ravnborg <sam@ravnborg.org> wrote:
> From 6b54fb0a071c0732cd4bd5b88f456b5a85bcf4f2 Mon Sep 17 00:00:00 2001
> From: Sam Ravnborg <sam@ravnborg.org>
> Date: Mon, 20 Jan 2020 19:55:04 +0100
> Subject: [PATCH] dt-bindings: restrict properties for sitronix,st7735r
>
> David Lechner noticed (paraphrased):
> - not all properties from panel-common are applicable.
> - missing optional rotation and backlight properties
>
> Fix this by listing all allowed properties, and do not allow other properties.
>
> Fixes: abdd9e3705c8 ("dt-bindings: display: sitronix,st7735r: Convert to DT schema")
> Reported-by: David Lechner <david@lechnology.com>
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

I'm far from a DT yaml expert, but LGTM, so:
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert
Rob Herring (Arm) Jan. 23, 2020, 2:41 p.m. UTC | #3
On Mon, Jan 20, 2020 at 08:02:49PM +0100, Sam Ravnborg wrote:
> Hi David.
> 
> > > +allOf:
> > > +  - $ref: panel/panel-common.yaml#
> > 
> > not all of these properties are applicable.
> > 
> 
> > > +required:
> > > +  - compatible
> > > +  - reg
> > > +  - dc-gpios
> > > +  - reset-gpios
> > 
> > Missing optional rotation and backlight properties.
> 
> Thanks for catching this. I have written a little .yaml files
> since I applied this - and learned a little more of the syntax.
> 
> See attached patch for my attempt to fix this.
> Please review.
> 
> 	Sam
> 
> From 6b54fb0a071c0732cd4bd5b88f456b5a85bcf4f2 Mon Sep 17 00:00:00 2001
> From: Sam Ravnborg <sam@ravnborg.org>
> Date: Mon, 20 Jan 2020 19:55:04 +0100
> Subject: [PATCH] dt-bindings: restrict properties for sitronix,st7735r
> 
> David Lechner noticed (paraphrased):
> - not all properties from panel-common are applicable.
> - missing optional rotation and backlight properties
> 
> Fix this by listing all allowed properties, and do not allow other properties.
> 
> Fixes: abdd9e3705c8 ("dt-bindings: display: sitronix,st7735r: Convert to DT schema")
> Reported-by: David Lechner <david@lechnology.com>
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: David Lechner <david@lechnology.com>
> Cc: Rob Herring <robh@kernel.org>
> Cc: dri-devel@lists.freedesktop.org
> ---
>  .../devicetree/bindings/display/sitronix,st7735r.yaml      | 7 +++++++
>  1 file changed, 7 insertions(+)

Acked-by: Rob Herring <robh@kernel.org>
Sam Ravnborg Jan. 23, 2020, 6:19 p.m. UTC | #4
Hi Geert & Rob.

On Thu, Jan 23, 2020 at 08:43:39AM +0100, Geert Uytterhoeven wrote:
> Hi Sam,
> 
> On Mon, Jan 20, 2020 at 8:02 PM Sam Ravnborg <sam@ravnborg.org> wrote:
> > From 6b54fb0a071c0732cd4bd5b88f456b5a85bcf4f2 Mon Sep 17 00:00:00 2001
> > From: Sam Ravnborg <sam@ravnborg.org>
> > Date: Mon, 20 Jan 2020 19:55:04 +0100
> > Subject: [PATCH] dt-bindings: restrict properties for sitronix,st7735r
> >
> > David Lechner noticed (paraphrased):
> > - not all properties from panel-common are applicable.
> > - missing optional rotation and backlight properties
> >
> > Fix this by listing all allowed properties, and do not allow other properties.
> >
> > Fixes: abdd9e3705c8 ("dt-bindings: display: sitronix,st7735r: Convert to DT schema")
> > Reported-by: David Lechner <david@lechnology.com>
> > Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> 
> I'm far from a DT yaml expert, but LGTM, so:
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Thanks, now pushed to drm-misc-next.

	Sam
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml b/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml
index 8892d79e6e10..0cebaaefda03 100644
--- a/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml
+++ b/Documentation/devicetree/bindings/display/sitronix,st7735r.yaml
@@ -39,12 +39,19 @@  properties:
     maxItems: 1
     description: Display data/command selection (D/CX)
 
+  backlight: true
+  reg: true
+  reset-gpios: true
+  rotation: true
+
 required:
   - compatible
   - reg
   - dc-gpios
   - reset-gpios
 
+additionalProperties: false
+
 examples:
   - |
     #include <dt-bindings/gpio/gpio.h>