From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Daniel Golle <daniel@makrotopia.org>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>,
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] nvmem: core: append offset to cell name in sysfs
Date: Tue, 18 Jul 2023 16:44:09 +0200 [thread overview]
Message-ID: <2023071830-ruby-atop-99e6@gregkh> (raw)
In-Reply-To: <ZLaZ7fzUSsa0Igx1@makrotopia.org>
On Tue, Jul 18, 2023 at 02:55:57PM +0100, Daniel Golle wrote:
> The device tree node names are not required to be unique. Append the
> offset to the name to make cell nodes with identical names become
> accessible via sysfs and avoid kernel stackdump caused by
> sysfs: cannot create duplicate filename '...'
>
> Fixes: 757f8b3835c9 ("nvmem: core: Expose cells through sysfs")
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> ---
> drivers/nvmem/core.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
> index 70e951088826d..90fe9dc30f8ba 100644
> --- a/drivers/nvmem/core.c
> +++ b/drivers/nvmem/core.c
> @@ -480,7 +480,9 @@ static int nvmem_populate_sysfs_cells(struct nvmem_device *nvmem)
> /* Initialize each attribute to take the name and size of the cell */
> list_for_each_entry(entry, &nvmem->cells, node) {
> sysfs_bin_attr_init(&attrs[i]);
> - attrs[i].attr.name = devm_kstrdup(&nvmem->dev, entry->name, GFP_KERNEL);
> + attrs[i].attr.name = devm_kasprintf(&nvmem->dev, GFP_KERNEL,
> + "%s@%d", entry->name,
> + entry->offset);
No documenatation update to show the new naming scheme?
And again, I don't see that git id in Linus's tree, am I just not up to
date properly?
thanks,
greg k-h
next prev parent reply other threads:[~2023-07-18 14:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-18 13:55 [PATCH 2/2] nvmem: core: append offset to cell name in sysfs Daniel Golle
2023-07-18 14:44 ` Greg Kroah-Hartman [this message]
2023-07-31 15:45 ` Miquel Raynal
2023-07-31 15:54 ` Daniel Golle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2023071830-ruby-atop-99e6@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=daniel@makrotopia.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miquel.raynal@bootlin.com \
--cc=srinivas.kandagatla@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.