linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: mtd: partitions: make partition an NVMEM provider
@ 2024-01-11 12:19 Rafał Miłecki
  2024-01-11 12:26 ` Rafał Miłecki
  2024-01-19 22:33 ` Rob Herring
  0 siblings, 2 replies; 3+ messages in thread
From: Rafał Miłecki @ 2024-01-11 12:19 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Ansuel Smith, linux-mtd, devicetree, linux-kernel,
	Rafał Miłecki

From: Rafał Miłecki <rafal@milecki.pl>

MTD partition provides flash device data and can be used as NVMEM
device.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 .../bindings/mtd/partitions/partition.yaml       | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/Documentation/devicetree/bindings/mtd/partitions/partition.yaml b/Documentation/devicetree/bindings/mtd/partitions/partition.yaml
index 1ebe9e2347ea..7b1d84ce5ef5 100644
--- a/Documentation/devicetree/bindings/mtd/partitions/partition.yaml
+++ b/Documentation/devicetree/bindings/mtd/partitions/partition.yaml
@@ -57,13 +57,15 @@ properties:
       user space from
     type: boolean
 
-if:
-  not:
-    required: [ reg ]
-then:
-  properties:
-    $nodename:
-      pattern: '^partition-.*$'
+allOf:
+  - $ref: /schemas/nvmem/nvmem.yaml
+  - if:
+      not:
+        required: [ reg ]
+    then:
+      properties:
+        $nodename:
+          pattern: '^partition-.*$'
 
 # This is a generic file other binding inherit from and extend
 additionalProperties: true
-- 
2.35.3


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

* Re: [PATCH] dt-bindings: mtd: partitions: make partition an NVMEM provider
  2024-01-11 12:19 [PATCH] dt-bindings: mtd: partitions: make partition an NVMEM provider Rafał Miłecki
@ 2024-01-11 12:26 ` Rafał Miłecki
  2024-01-19 22:33 ` Rob Herring
  1 sibling, 0 replies; 3+ messages in thread
From: Rafał Miłecki @ 2024-01-11 12:26 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Ansuel Smith, linux-mtd, devicetree, linux-kernel,
	Rafał Miłecki, Srinivas Kandagatla, Greg Kroah-Hartman

Cc Srini & Greg (please keep them in loop in case or replies)

On 11.01.2024 13:19, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> MTD partition provides flash device data and can be used as NVMEM
> device.
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
>   .../bindings/mtd/partitions/partition.yaml       | 16 +++++++++-------
>   1 file changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/mtd/partitions/partition.yaml b/Documentation/devicetree/bindings/mtd/partitions/partition.yaml
> index 1ebe9e2347ea..7b1d84ce5ef5 100644
> --- a/Documentation/devicetree/bindings/mtd/partitions/partition.yaml
> +++ b/Documentation/devicetree/bindings/mtd/partitions/partition.yaml
> @@ -57,13 +57,15 @@ properties:
>         user space from
>       type: boolean
>   
> -if:
> -  not:
> -    required: [ reg ]
> -then:
> -  properties:
> -    $nodename:
> -      pattern: '^partition-.*$'
> +allOf:
> +  - $ref: /schemas/nvmem/nvmem.yaml
> +  - if:
> +      not:
> +        required: [ reg ]
> +    then:
> +      properties:
> +        $nodename:
> +          pattern: '^partition-.*$'
>   
>   # This is a generic file other binding inherit from and extend
>   additionalProperties: true


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

* Re: [PATCH] dt-bindings: mtd: partitions: make partition an NVMEM provider
  2024-01-11 12:19 [PATCH] dt-bindings: mtd: partitions: make partition an NVMEM provider Rafał Miłecki
  2024-01-11 12:26 ` Rafał Miłecki
@ 2024-01-19 22:33 ` Rob Herring
  1 sibling, 0 replies; 3+ messages in thread
From: Rob Herring @ 2024-01-19 22:33 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Krzysztof Kozlowski, Conor Dooley, Ansuel Smith, linux-mtd,
	devicetree, linux-kernel, Rafał Miłecki

On Thu, Jan 11, 2024 at 01:19:40PM +0100, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> MTD partition provides flash device data and can be used as NVMEM
> device.

I don't follow what is the relationship between this and your other 
series.

> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
>  .../bindings/mtd/partitions/partition.yaml       | 16 +++++++++-------
>  1 file changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/mtd/partitions/partition.yaml b/Documentation/devicetree/bindings/mtd/partitions/partition.yaml
> index 1ebe9e2347ea..7b1d84ce5ef5 100644
> --- a/Documentation/devicetree/bindings/mtd/partitions/partition.yaml
> +++ b/Documentation/devicetree/bindings/mtd/partitions/partition.yaml
> @@ -57,13 +57,15 @@ properties:
>        user space from
>      type: boolean
>  
> -if:
> -  not:
> -    required: [ reg ]
> -then:
> -  properties:
> -    $nodename:
> -      pattern: '^partition-.*$'
> +allOf:
> +  - $ref: /schemas/nvmem/nvmem.yaml

Only some partitions are nvmem nodes, so we shouldn't always include it. 
Then we can't exclude nvmem properties from partition nodes which 
aren't. We should identify those nodes by compatible and their schema 
should reference partition.yaml and nvmem.yaml.

There's a general problem with the partition related schemas that 
undefined properties are not caught. This is partly because 
partition nodes can be nested and expressing that with the schema is 
hard.

Rob

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

end of thread, other threads:[~2024-01-19 22:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-11 12:19 [PATCH] dt-bindings: mtd: partitions: make partition an NVMEM provider Rafał Miłecki
2024-01-11 12:26 ` Rafał Miłecki
2024-01-19 22:33 ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).