[PATCH V3] nvmem: add explicit config option to read OF fixed cells

Miquel Raynal miquel.raynal at bootlin.com
Thu Mar 9 03:35:13 PST 2023

Hi Rafał,

> diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h
> index 0262b86194eb..b3c14ce87a65 100644
> --- a/include/linux/nvmem-provider.h
> +++ b/include/linux/nvmem-provider.h
> @@ -73,6 +73,7 @@ struct nvmem_cell_info {
>   * @owner:	Pointer to exporter module. Used for refcounting.
>   * @cells:	Optional array of pre-defined NVMEM cells.
>   * @ncells:	Number of elements in cells.
> + * @use_fixed_of_cells:	Read fixed NVMEM cells from OF.

I'm still unhappy with the naming, especially since you explained in
more details the whole plan which involves using a container to put
these fixed cells from now on. In both cases you extract cells from
fixed OF nodes but this boolean needs to be set to true in one
case, and false in the other, which would not make sense.

Also, regarding the bindings changes, I'm fairly happy with the idea,
but if we go this way I would prefer a full series instead of
individual changes with:

- the boolean you introduce here (renamed, at the very least)
- the new bindings
- the update of the current provider bindings to take the new bindings
  into account and deprecate the old ones officially
- support for the new bindings in the core

>   * @keepout:	Optional array of keepout ranges (sorted ascending by start).
>   * @nkeepout:	Number of elements in the keepout array.
>   * @type:	Type of the nvmem storage
> @@ -103,6 +104,7 @@ struct nvmem_config {
>  	struct module		*owner;
>  	const struct nvmem_cell_info	*cells;
>  	int			ncells;
> +	bool			use_fixed_of_cells;
>  	const struct nvmem_keepout *keepout;
>  	unsigned int		nkeepout;
>  	enum nvmem_type		type;


More information about the linux-mtd mailing list