linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mtd: Fix the check on nvmem_register() ret code
@ 2019-01-02 14:36 Boris Brezillon
  2019-01-02 14:36 ` [PATCH 2/2] mtd: Check add_mtd_device() " Boris Brezillon
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Boris Brezillon @ 2019-01-02 14:36 UTC (permalink / raw)
  To: David Woodhouse, Brian Norris, Boris Brezillon, Marek Vasut,
	Richard Weinberger, linux-mtd
  Cc: Boris Brezillon, Bartosz Golaszewski, Alban Bedel

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

^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2019-04-01 13:28 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-02 14:36 [PATCH 1/2] mtd: Fix the check on nvmem_register() ret code Boris Brezillon
2019-01-02 14:36 ` [PATCH 2/2] mtd: Check add_mtd_device() " 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).