diff mbox series

[v2,10/17] dt-bindings: mtd: brcmnand: Prevent NAND chip unevaluated properties

Message ID 20230606175246.190465-11-miquel.raynal@bootlin.com
State Not Applicable, archived
Headers show
Series Prevent NAND chip unevaluated properties | expand

Checks

Context Check Description
robh/checkpatch success
robh/patch-applied success
robh/dt-meta-schema fail build log

Commit Message

Miquel Raynal June 6, 2023, 5:52 p.m. UTC
Ensure all raw NAND chip properties are valid by referencing the
relevant schema and set unevaluatedProperties to false in the NAND chip
section to avoid spurious additions of random properties.

Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Kamal Dasu <kdasu.kdev@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml | 3 +++
 1 file changed, 3 insertions(+)

Comments

Rob Herring (Arm) June 6, 2023, 6:52 p.m. UTC | #1
On Tue, 06 Jun 2023 19:52:39 +0200, Miquel Raynal wrote:
> Ensure all raw NAND chip properties are valid by referencing the
> relevant schema and set unevaluatedProperties to false in the NAND chip
> section to avoid spurious additions of random properties.
> 
> Cc: Brian Norris <computersforpeace@gmail.com>
> Cc: Kamal Dasu <kdasu.kdev@gmail.com>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
>  Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml | 3 +++
>  1 file changed, 3 insertions(+)
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
./Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml: Unable to find schema file matching $id: http://devicetree.org/schemas/mtd/raw-nand-chip.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mtd/brcm,brcmnand.example.dtb: nand-controller@f0442800: nand@1: False schema does not allow {'compatible': ['brcm,nandcs'], 'reg': [[1]], 'nand-on-flash-bbt': True, 'nand-ecc-strength': [[12]], 'nand-ecc-step-size': [[512]], '#address-cells': [[1]], '#size-cells': [[1]]}
	From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mtd/brcm,brcmnand.example.dtb: nand-controller@f0442800: nand@1: Unevaluated properties are not allowed ('#address-cells', '#size-cells', 'nand-ecc-strength', 'nand-on-flash-bbt', 'reg' were unexpected)
	From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mtd/brcm,brcmnand.example.dtb: nand-controller@10000200: nand@0: False schema does not allow {'compatible': ['brcm,nandcs'], 'reg': [[0]], 'nand-on-flash-bbt': True, 'nand-ecc-strength': [[1]], 'nand-ecc-step-size': [[512]], '#address-cells': [[1]], '#size-cells': [[1]]}
	From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mtd/brcm,brcmnand.example.dtb: nand-controller@10000200: nand@0: Unevaluated properties are not allowed ('#address-cells', '#size-cells', 'nand-ecc-strength', 'nand-on-flash-bbt', 'reg' were unexpected)
	From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230606175246.190465-11-miquel.raynal@bootlin.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml b/Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml
index 1571024aa119..f57e96374e67 100644
--- a/Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml
+++ b/Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml
@@ -114,6 +114,7 @@  properties:
 patternProperties:
   "^nand@[a-f0-9]$":
     type: object
+    $ref: raw-nand-chip.yaml
     properties:
       compatible:
         const: brcm,nandcs
@@ -136,6 +137,8 @@  patternProperties:
           layout.
         $ref: /schemas/types.yaml#/definitions/uint32
 
+    unevaluatedProperties: false
+
 allOf:
   - $ref: nand-controller.yaml#
   - if: