mtd: nand: Fix a couple error codes
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Wed May 10 19:59:13 PDT 2017
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=70106ddaf31150a57dc00b3d7d5167f693b521ef
Commit: 70106ddaf31150a57dc00b3d7d5167f693b521ef
Parent: 477544c62a84d3bacd9f90ba75ffc16c04d78071
Author: Dan Carpenter <dan.carpenter at oracle.com>
AuthorDate: Tue Apr 4 11:15:46 2017 +0300
Committer: Boris Brezillon <boris.brezillon at free-electrons.com>
CommitDate: Tue Apr 25 14:18:39 2017 +0200
mtd: nand: Fix a couple error codes
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 at oracle.com>
Signed-off-by: Boris Brezillon <boris.brezillon at free-electrons.com>
---
drivers/mtd/nand/atmel/nand-controller.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/nand/atmel/nand-controller.c b/drivers/mtd/nand/atmel/nand-controller.c
index 80e2459..c11f358 100644
--- a/drivers/mtd/nand/atmel/nand-controller.c
+++ b/drivers/mtd/nand/atmel/nand-controller.c
@@ -1685,7 +1685,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;
}
@@ -1718,7 +1718,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;
}
More information about the linux-mtd-cvs
mailing list