public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [patch] mtd: nand: Fix a couple error codes
@ 2017-04-04  8:15 Dan Carpenter
  2017-04-04  9:27 ` Marek Vasut
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Dan Carpenter @ 2017-04-04  8:15 UTC (permalink / raw)
  To: Wenyou Yang, Boris Brezillon
  Cc: Josh Wu, Richard Weinberger, David Woodhouse, Brian Norris,
	Marek Vasut, Cyrille Pitchen, linux-mtd, kernel-janitors

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;
 	}

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

end of thread, other threads:[~2017-04-11 11:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-04  8:15 [patch] mtd: nand: Fix a couple error codes Dan Carpenter
2017-04-04  9:27 ` Marek Vasut
2017-04-09 14:33 ` Boris Brezillon
2017-04-10  7:09   ` Dan Carpenter
2017-04-11  8:09     ` Boris Brezillon
2017-04-11 11:37 ` Boris Brezillon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox