[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ba0b8125-6094-d042-a391-edcc2f68a114@linaro.org>
Date: Tue, 2 Jan 2018 11:44:24 +0000
From: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
To: Andrey Smirnov <andrew.smirnov@...il.com>
Cc: Heiko Stuebner <heiko@...ech.de>,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
Carlo Caione <carlo@...one.org>,
Kevin Hilman <khilman@...libre.com>,
Matthias Brugger <matthias.bgg@...il.com>, cphealy@...il.com,
linux-kernel@...r.kernel.org, linux-mediatek@...ts.infradead.org,
linux-rockchip@...ts.infradead.org,
linux-amlogic@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v2 01/21] nvmem: core: Allow specifying device name
verbatim
Thanks for the Patch,
On 01/01/18 23:22, Andrey Smirnov wrote:
> Add code to allow avoid having nvmem core append a numeric suffix to
> the end of the name by passing config->id of -1.
>
> Cc: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
> Cc: Heiko Stuebner <heiko@...ech.de>
> Cc: Masahiro Yamada <yamada.masahiro@...ionext.com>
> Cc: Carlo Caione <carlo@...one.org>
> Cc: Kevin Hilman <khilman@...libre.com>
> Cc: Matthias Brugger <matthias.bgg@...il.com>
> Cc: cphealy@...il.com
> Cc: linux-kernel@...r.kernel.org
> Cc: linux-mediatek@...ts.infradead.org
> Cc: linux-rockchip@...ts.infradead.org
> Cc: linux-amlogic@...ts.infradead.org
> Cc: linux-arm-kernel@...ts.infradead.org
> Signed-off-by: Andrey Smirnov <andrew.smirnov@...il.com>
> ---
> drivers/nvmem/core.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
This looks fine for me, Can you also add a line in kernel doc about this
behavior.
thanks,
srini
> diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
> index 5a5cefd12153..57cbeacfbeb2 100644
> --- a/drivers/nvmem/core.c
> +++ b/drivers/nvmem/core.c
> @@ -475,9 +475,14 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config)
> nvmem->reg_write = config->reg_write;
> np = config->dev->of_node;
> nvmem->dev.of_node = np;
> - dev_set_name(&nvmem->dev, "%s%d",
> - config->name ? : "nvmem",
> - config->name ? config->id : nvmem->id);
> +
> + if (config->id == -1 && config->name) {
> + dev_set_name(&nvmem->dev, "%s", config->name);
> + } else {
> + dev_set_name(&nvmem->dev, "%s%d",
> + config->name ? : "nvmem",
> + config->name ? config->id : nvmem->id);
> + }
>
> nvmem->read_only = of_property_read_bool(np, "read-only") |
> config->read_only;
>
Powered by blists - more mailing lists