From: Boris Brezillon <bbrezillon@kernel.org>
To: David Woodhouse <dwmw2@infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
Boris Brezillon <boris.brezillon@bootlin.com>,
Marek Vasut <marek.vasut@gmail.com>,
Richard Weinberger <richard@nod.at>,
linux-mtd@lists.infradead.org
Cc: Boris Brezillon <bbrezillon@kernel.org>,
Bartosz Golaszewski <brgl@bgdev.pl>, Alban Bedel <albeu@free.fr>
Subject: [PATCH 1/2] mtd: Fix the check on nvmem_register() ret code
Date: Wed, 2 Jan 2019 15:36:53 +0100 [thread overview]
Message-ID: <20190102143654.24362-1-bbrezillon@kernel.org> (raw)
Commit 20167b70c894 ("nvmem: use EOPNOTSUPP instead of ENOSYS") changed
the nvmem_register() ret code from ENOSYS to EOPNOTSUPP when
CONFIG_NVMEM is not enabled, but the check in mtd_nvmem_add() was not
adjusted accordingly.
Cc: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Alban Bedel <albeu@free.fr>
Fixes: c4dfa25ab307 ("mtd: add support for reading MTD devices via the nvmem API")
Reported-by: kernel test robot <rong.a.chen@intel.com>
Signed-off-by: Boris Brezillon <bbrezillon@kernel.org>
---
drivers/mtd/mtdcore.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index 21e3cdc04036..999b705769a8 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -522,7 +522,7 @@ static int mtd_nvmem_add(struct mtd_info *mtd)
mtd->nvmem = nvmem_register(&config);
if (IS_ERR(mtd->nvmem)) {
/* Just ignore if there is no NVMEM support in the kernel */
- if (PTR_ERR(mtd->nvmem) == -ENOSYS) {
+ if (PTR_ERR(mtd->nvmem) == -EOPNOTSUPP) {
mtd->nvmem = NULL;
} else {
dev_err(&mtd->dev, "Failed to register NVMEM device\n");
--
2.17.1
next reply other threads:[~2019-01-02 14:37 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-02 14:36 Boris Brezillon [this message]
2019-01-02 14:36 ` [PATCH 2/2] mtd: Check add_mtd_device() ret code Boris Brezillon
2019-01-08 8:29 ` [2/2] " Boris Brezillon
2019-01-22 11:21 ` [PATCH 2/2] " Geert Uytterhoeven
2019-01-22 12:31 ` Boris Brezillon
2019-01-29 11:03 ` Boris Brezillon
2019-01-29 15:29 ` Geert Uytterhoeven
2019-01-30 8:52 ` Boris Brezillon
2019-01-30 9:05 ` Geert Uytterhoeven
2019-01-30 9:10 ` Boris Brezillon
2019-01-30 9:16 ` Geert Uytterhoeven
2019-02-01 8:50 ` Boris Brezillon
2019-02-01 9:02 ` Geert Uytterhoeven
2019-01-30 9:17 ` Boris Brezillon
2019-01-30 8:55 ` Boris Brezillon
2019-01-30 9:12 ` Geert Uytterhoeven
2019-04-01 9:50 ` Geert Uytterhoeven
2019-04-01 13:27 ` Boris Brezillon
2019-01-02 15:13 ` [PATCH 1/2] mtd: Fix the check on nvmem_register() " Bartosz Golaszewski
2019-01-08 8:30 ` [1/2] " Boris Brezillon
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=20190102143654.24362-1-bbrezillon@kernel.org \
--to=bbrezillon@kernel.org \
--cc=albeu@free.fr \
--cc=boris.brezillon@bootlin.com \
--cc=brgl@bgdev.pl \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
--cc=richard@nod.at \
/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.