[PATCH v3 01/17] spi: dt-bindings: cdns,qspi-nor: Remove duplicated constraints

Miquel Raynal (Schneider Electric) posted 17 patches 2 weeks, 6 days ago
There is a newer version of this series
[PATCH v3 01/17] spi: dt-bindings: cdns,qspi-nor: Remove duplicated constraints
Posted by Miquel Raynal (Schneider Electric) 2 weeks, 6 days ago
The if/then/else block sets the restrictions in all cases for
resets/reset-names, very much like it does for other properties as well
such as cdns,fifo-depth. Drop the constraints from the place where these
constraints are simply ignored.

Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
---
 Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml b/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
index 53a52fb8b819..b85dba351822 100644
--- a/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
+++ b/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
@@ -136,15 +136,8 @@ properties:
   power-domains:
     maxItems: 1
 
-  resets:
-    minItems: 2
-    maxItems: 3
-
-  reset-names:
-    minItems: 2
-    maxItems: 3
-    items:
-      enum: [ qspi, qspi-ocp, rstc_ref ]
+  resets: true
+  reset-names: true
 
 patternProperties:
   "^flash@[0-9a-f]+$":

-- 
2.51.1
Re: [PATCH v3 01/17] spi: dt-bindings: cdns,qspi-nor: Remove duplicated constraints
Posted by Rob Herring 2 weeks, 6 days ago
On Wed, Jan 21, 2026 at 06:04:57PM +0100, Miquel Raynal (Schneider Electric) wrote:
> The if/then/else block sets the restrictions in all cases for
> resets/reset-names, very much like it does for other properties as well
> such as cdns,fifo-depth. Drop the constraints from the place where these
> constraints are simply ignored.

But they aren't.

> Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
> ---
>  Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml | 11 ++---------
>  1 file changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml b/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
> index 53a52fb8b819..b85dba351822 100644
> --- a/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
> +++ b/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
> @@ -136,15 +136,8 @@ properties:
>    power-domains:
>      maxItems: 1
>  
> -  resets:
> -    minItems: 2
> -    maxItems: 3
> -
> -  reset-names:
> -    minItems: 2
> -    maxItems: 3
> -    items:
> -      enum: [ qspi, qspi-ocp, rstc_ref ]

The primary reason to keep this is to prevent making up other names. If 
the names are only in if/then schemas then anything is allowed and it's 
not visible in reviews.

Rob
Re: [PATCH v3 01/17] spi: dt-bindings: cdns,qspi-nor: Remove duplicated constraints
Posted by Miquel Raynal 2 weeks, 5 days ago
On 21/01/2026 at 16:14:00 -06, Rob Herring <robh@kernel.org> wrote:

> On Wed, Jan 21, 2026 at 06:04:57PM +0100, Miquel Raynal (Schneider Electric) wrote:
>> The if/then/else block sets the restrictions in all cases for
>> resets/reset-names, very much like it does for other properties as well
>> such as cdns,fifo-depth. Drop the constraints from the place where these
>> constraints are simply ignored.
>
> But they aren't.

I looked deeper. Indeed the two constraints are applied, and it works
because the constraints in "if" blocks must be subsets of what is
already a constraint in the main body.

...

>> -  resets:
>> -    minItems: 2
>> -    maxItems: 3
>> -
>> -  reset-names:
>> -    minItems: 2
>> -    maxItems: 3
>> -    items:
>> -      enum: [ qspi, qspi-ocp, rstc_ref ]
>
> The primary reason to keep this is to prevent making up other names. If 
> the names are only in if/then schemas then anything is allowed and it's 
> not visible in reviews.

Makes sense. I will drop this patch.

Thanks,
Miquèl