Re: [PATCH v6 3/3] mtd: core: introduce of support for dynamic partitions

From: Miquel Raynal
Date: Wed Jun 29 2022 - 07:38:51 EST


On Wed, 2022-06-22 at 01:06:28 UTC, Christian Marangi wrote:
> We have many parser that register mtd partitions at runtime. One example
> is the cmdlinepart or the smem-part parser where the compatible is defined
> in the dts and the partitions gets detected and registered by the
> parser. This is problematic for the NVMEM subsystem that requires an OF
> node to detect NVMEM cells.
>
> To fix this problem, introduce an additional logic that will try to
> assign an OF node to the MTD if declared.
>
> On MTD addition, it will be checked if the MTD has an OF node and if
> not declared will check if a partition with the same label / node name is
> declared in DTS. If an exact match is found, the partition dynamically
> allocated by the parser will have a connected OF node.
>
> The NVMEM subsystem will detect the OF node and register any NVMEM cells
> declared statically in the DTS.
>
> Signed-off-by: Christian Marangi <ansuelsmth@xxxxxxxxx>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel