From: Sascha Hauer <sha@pengutronix.de>
To: Marco Felsch <m.felsch@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/4] nvmem: sync stub return values with linux code
Date: Tue, 19 Jan 2021 11:15:27 +0100 [thread overview]
Message-ID: <20210119101527.GW19063@pengutronix.de> (raw)
In-Reply-To: <20210118205528.9797-1-m.felsch@pengutronix.de>
On Mon, Jan 18, 2021 at 09:55:25PM +0100, Marco Felsch wrote:
> Based on linux commit:
> 8<------------------------------------------------------------------------
> commit 20167b70c894f20cd01e2579fad206de440816ef
> Author: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> Date: Fri Sep 21 06:40:22 2018 -0700
>
> nvmem: use EOPNOTSUPP instead of ENOSYS
>
> Checkpatch emits warnings when using ENOSYS. Some of the frameworks
> started using EOPNOTSUPP as return values for API functions when given
> subsystem is disabled in Kconfig.
>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 8<------------------------------------------------------------------------
>
> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
> ---
> include/linux/nvmem-consumer.h | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
Applied, thanks
Sascha
>
> diff --git a/include/linux/nvmem-consumer.h b/include/linux/nvmem-consumer.h
> index 9e0fd4265e..2f79014c0f 100644
> --- a/include/linux/nvmem-consumer.h
> +++ b/include/linux/nvmem-consumer.h
> @@ -50,7 +50,7 @@ int nvmem_device_cell_write(struct nvmem_device *nvmem,
> static inline struct nvmem_cell *nvmem_cell_get(struct device_d *dev,
> const char *name)
> {
> - return ERR_PTR(-ENOSYS);
> + return ERR_PTR(-EOPNOTSUPP);
> }
>
> static inline void nvmem_cell_put(struct nvmem_cell *cell)
> @@ -59,26 +59,26 @@ static inline void nvmem_cell_put(struct nvmem_cell *cell)
>
> static inline char *nvmem_cell_read(struct nvmem_cell *cell, size_t *len)
> {
> - return ERR_PTR(-ENOSYS);
> + return ERR_PTR(-EOPNOTSUPP);
> }
>
> static inline void *nvmem_cell_get_and_read(struct device_node *np,
> const char *cell_name,
> size_t bytes)
> {
> - return ERR_PTR(-ENOSYS);
> + return ERR_PTR(-EOPNOTSUPP);
> }
>
> static inline int nvmem_cell_write(struct nvmem_cell *cell,
> const char *buf, size_t len)
> {
> - return -ENOSYS;
> + return -EOPNOTSUPP;
> }
>
> static inline struct nvmem_device *nvmem_device_get(struct device_d *dev,
> const char *name)
> {
> - return ERR_PTR(-ENOSYS);
> + return ERR_PTR(-EOPNOTSUPP);
> }
>
> static inline void nvmem_device_put(struct nvmem_device *nvmem)
> --
> 2.20.1
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2021-01-19 10:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-18 20:55 Marco Felsch
2021-01-18 20:55 ` [PATCH 2/4] nvmem: add missing stubs Marco Felsch
2021-01-18 20:55 ` [PATCH 3/4] nvmem: make nvmem_device_write/read public Marco Felsch
2021-01-18 20:55 ` [PATCH 4/4] nvmem: make id optional for of_nvmem_device_get() Marco Felsch
2021-01-19 10:15 ` Sascha Hauer [this message]
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=20210119101527.GW19063@pengutronix.de \
--to=sha@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=m.felsch@pengutronix.de \
/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