From: Dan Carpenter <dan.carpenter@oracle.com>
To: Wenyou Yang <wenyou.yang@atmel.com>,
Boris Brezillon <boris.brezillon@free-electrons.com>
Cc: Josh Wu <rainyfeeling@outlook.com>,
Richard Weinberger <richard@nod.at>,
David Woodhouse <dwmw2@infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
Marek Vasut <marek.vasut@gmail.com>,
Cyrille Pitchen <cyrille.pitchen@atmel.com>,
linux-mtd@lists.infradead.org, kernel-janitors@vger.kernel.org
Subject: [patch] mtd: nand: Fix a couple error codes
Date: Tue, 04 Apr 2017 08:15:46 +0000 [thread overview]
Message-ID: <20170404081545.GA25533@mwanda> (raw)
We accidentally return 1 on error instead of proper error codes.
Fixes: 07b23e3db9ed ("mtd: nand: Cleanup/rework the atmel_nand driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/mtd/nand/atmel/nand-controller.c b/drivers/mtd/nand/atmel/nand-controller.c
index 27301603f394..b8d17a024dbd 100644
--- a/drivers/mtd/nand/atmel/nand-controller.c
+++ b/drivers/mtd/nand/atmel/nand-controller.c
@@ -1686,7 +1686,7 @@ static int atmel_nand_controller_init(struct atmel_nand_controller *nc,
nc->smc = syscon_node_to_regmap(np);
of_node_put(np);
if (IS_ERR(nc->smc)) {
- ret = IS_ERR(nc->smc);
+ ret = PTR_ERR(nc->smc);
dev_err(dev, "Could not get SMC regmap (err = %d)\n", ret);
return ret;
}
@@ -1719,7 +1719,7 @@ atmel_smc_nand_controller_init(struct atmel_smc_nand_controller *nc)
nc->matrix = syscon_node_to_regmap(np);
of_node_put(np);
if (IS_ERR(nc->matrix)) {
- ret = IS_ERR(nc->matrix);
+ ret = PTR_ERR(nc->matrix);
dev_err(dev, "Could not get Matrix regmap (err = %d)\n", ret);
return ret;
}
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Wenyou Yang <wenyou.yang@atmel.com>,
Boris Brezillon <boris.brezillon@free-electrons.com>
Cc: Josh Wu <rainyfeeling@outlook.com>,
Richard Weinberger <richard@nod.at>,
David Woodhouse <dwmw2@infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
Marek Vasut <marek.vasut@gmail.com>,
Cyrille Pitchen <cyrille.pitchen@atmel.com>,
linux-mtd@lists.infradead.org, kernel-janitors@vger.kernel.org
Subject: [patch] mtd: nand: Fix a couple error codes
Date: Tue, 4 Apr 2017 11:15:46 +0300 [thread overview]
Message-ID: <20170404081545.GA25533@mwanda> (raw)
We accidentally return 1 on error instead of proper error codes.
Fixes: 07b23e3db9ed ("mtd: nand: Cleanup/rework the atmel_nand driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/mtd/nand/atmel/nand-controller.c b/drivers/mtd/nand/atmel/nand-controller.c
index 27301603f394..b8d17a024dbd 100644
--- a/drivers/mtd/nand/atmel/nand-controller.c
+++ b/drivers/mtd/nand/atmel/nand-controller.c
@@ -1686,7 +1686,7 @@ static int atmel_nand_controller_init(struct atmel_nand_controller *nc,
nc->smc = syscon_node_to_regmap(np);
of_node_put(np);
if (IS_ERR(nc->smc)) {
- ret = IS_ERR(nc->smc);
+ ret = PTR_ERR(nc->smc);
dev_err(dev, "Could not get SMC regmap (err = %d)\n", ret);
return ret;
}
@@ -1719,7 +1719,7 @@ atmel_smc_nand_controller_init(struct atmel_smc_nand_controller *nc)
nc->matrix = syscon_node_to_regmap(np);
of_node_put(np);
if (IS_ERR(nc->matrix)) {
- ret = IS_ERR(nc->matrix);
+ ret = PTR_ERR(nc->matrix);
dev_err(dev, "Could not get Matrix regmap (err = %d)\n", ret);
return ret;
}
next reply other threads:[~2017-04-04 8:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-04 8:15 Dan Carpenter [this message]
2017-04-04 8:15 ` [patch] mtd: nand: Fix a couple error codes Dan Carpenter
2017-04-04 9:27 ` Marek Vasut
2017-04-04 9:27 ` Marek Vasut
2017-04-09 14:33 ` Boris Brezillon
2017-04-09 14:33 ` Boris Brezillon
2017-04-10 7:09 ` Dan Carpenter
2017-04-10 7:09 ` Dan Carpenter
2017-04-11 8:09 ` Boris Brezillon
2017-04-11 8:09 ` Boris Brezillon
2017-04-11 11:37 ` Boris Brezillon
2017-04-11 11:37 ` 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=20170404081545.GA25533@mwanda \
--to=dan.carpenter@oracle.com \
--cc=boris.brezillon@free-electrons.com \
--cc=computersforpeace@gmail.com \
--cc=cyrille.pitchen@atmel.com \
--cc=dwmw2@infradead.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
--cc=rainyfeeling@outlook.com \
--cc=richard@nod.at \
--cc=wenyou.yang@atmel.com \
/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.