From: sashiko-bot@kernel.org
To: "Link Mauve" <linkmauve@linkmauve.fr>
Cc: neil.armstrong@linaro.org, ojeda@kernel.org,
linux-amlogic@lists.infradead.org, Frank.Li@kernel.org,
imx@lists.linux.dev, gary@garyguo.net
Subject: Re: [PATCH v6 2/4] nvmem: core: deprecate reg_write callback with reg_write_const
Date: Sun, 20 Sep 2026 11:19:59 +0000 [thread overview]
Message-ID: <20260920111959.957A51F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260920111000.2404131-3-linkmauve@linkmauve.fr>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] nvmem: dev_warn uses uninitialized device name in nvmem_register()
--
commit 77653927bdf19b36c155e416a676051598da0213
Author: Link Mauve <linkmauve@linkmauve.fr>
nvmem: core: deprecate reg_write callback with reg_write_const
This commit deprecates the reg_write callback in favor of reg_write_const,
which takes a const pointer for the value buffer. It also adds a deprecation
warning in nvmem_register() for drivers still using the old callback.
> diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
> index 0556d140170a4..a484d424119f9 100644
> --- a/drivers/nvmem/core.c
> +++ b/drivers/nvmem/core.c
[ ... ]
> @@ -937,6 +940,11 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config)
>
> ops->reg_read = config->reg_read;
> ops->reg_write = config->reg_write;
> + ops->reg_write_const = config->reg_write_const;
> +
> + if (ops->reg_write)
> + dev_warn(&nvmem->dev, "Usage of reg_write in nvmem is deprecated, please "
> + "migrate to reg_write_const.\n");
[Severity: Low]
Will this dev_warn() print an uninitialized device name, since dev_set_name()
hasn't been called on &nvmem->dev yet?
Looking further down in nvmem_register(), the device name is assigned later
in the switch block:
switch (config->id) {
case NVMEM_DEVID_NONE:
rval = dev_set_name(&nvmem->dev, "%s", config->name);
break;
...
Could this result in the log message printing an uninitialized name like
(null) or (unnamed), making it difficult to identify which driver triggered
the deprecation warning?
Would it make sense to use config->dev (the parent device) for the warning,
or move this check below the dev_set_name() block?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260920111000.2404131-1-linkmauve@linkmauve.fr?part=2
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
next prev parent reply other threads:[~2026-09-20 11:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-20 11:09 [PATCH v6 0/4] nvmem: migrate to const void * in reg_write Link Mauve
2026-09-20 11:09 ` [PATCH v6 1/4] firmware: meson: pass a const buffer to meson_sm_call_write() Link Mauve
2026-09-20 11:09 ` [PATCH v6 2/4] nvmem: core: deprecate reg_write callback with reg_write_const Link Mauve
2026-09-20 11:19 ` sashiko-bot [this message]
2026-09-20 11:09 ` [PATCH v6 3/4] nvmem: make all reg_write callbacks take const void * Link Mauve
2026-09-20 11:09 ` [PATCH v6 4/4] nvmem: enable COMPILE_TEST for more drivers Link Mauve
2026-09-20 11:23 ` sashiko-bot
2026-09-20 11:18 ` [PATCH v6 0/4] nvmem: migrate to const void * in reg_write Link Mauve
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=20260920111959.957A51F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=gary@garyguo.net \
--cc=imx@lists.linux.dev \
--cc=linkmauve@linkmauve.fr \
--cc=linux-amlogic@lists.infradead.org \
--cc=neil.armstrong@linaro.org \
--cc=ojeda@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®