[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <01b2adc922951f7d8cd74bc7bb1b42f1@walle.cc>
Date: Mon, 20 Mar 2023 09:23:11 +0100
From: Michael Walle <michael@...le.cc>
To: Rafał Miłecki <zajec5@...il.com>
Cc: Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Miquel Raynal <miquel.raynal@...tlin.com>,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
Rafał Miłecki
<rafal@...ecki.pl>
Subject: Re: [PATCH V4 3/4] nvmem: core: export nvmem_add_cells_from_of()
Am 2023-03-17 14:26, schrieb Rafał Miłecki:
> From: Rafał Miłecki <rafal@...ecki.pl>
>
> This symbol can be cleanly re-used by the fixed NVMEM layout driver.
> Allow passing DT node as argument to make it a bit more generic.
>
> Signed-off-by: Rafał Miłecki <rafal@...ecki.pl>
> ---
> drivers/nvmem/core.c | 7 ++++---
> include/linux/nvmem-provider.h | 7 +++++++
> 2 files changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
> index 212c5ba5789f..985a42cfb0a2 100644
> --- a/drivers/nvmem/core.c
> +++ b/drivers/nvmem/core.c
> @@ -694,7 +694,7 @@ static int nvmem_validate_keepouts(struct
> nvmem_device *nvmem)
> return 0;
> }
>
> -static int nvmem_add_cells_from_of(struct nvmem_device *nvmem)
> +int nvmem_add_cells_from_of(struct nvmem_device *nvmem, struct
> device_node *np)
I'm not sure, how to feel about exposing an "internal" function to
the layouts module. I mean all these nvmem_add_cells_from_* are internal
to the core. Also the help text of the add_cells() callback tells you to
use nvmem_add_one_cell().
Although there is a bit of code duplication, I'd rather refactor
the nvmem_add_cells_from_of() to split it into parsing and adding.
Then re-use just the parsing from the fixed layout module and
call the appropriate nvmem_add_one_cell() yourself there.
-michael
Powered by blists - more mailing lists