Commit 70106dda authored by Dan Carpenter's avatar Dan Carpenter Committed by Boris Brezillon

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
parent 477544c6
...@@ -1685,7 +1685,7 @@ static int atmel_nand_controller_init(struct atmel_nand_controller *nc, ...@@ -1685,7 +1685,7 @@ static int atmel_nand_controller_init(struct atmel_nand_controller *nc,
nc->smc = syscon_node_to_regmap(np); nc->smc = syscon_node_to_regmap(np);
of_node_put(np); of_node_put(np);
if (IS_ERR(nc->smc)) { 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); dev_err(dev, "Could not get SMC regmap (err = %d)\n", ret);
return ret; return ret;
} }
...@@ -1718,7 +1718,7 @@ atmel_smc_nand_controller_init(struct atmel_smc_nand_controller *nc) ...@@ -1718,7 +1718,7 @@ atmel_smc_nand_controller_init(struct atmel_smc_nand_controller *nc)
nc->matrix = syscon_node_to_regmap(np); nc->matrix = syscon_node_to_regmap(np);
of_node_put(np); of_node_put(np);
if (IS_ERR(nc->matrix)) { 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); dev_err(dev, "Could not get Matrix regmap (err = %d)\n", ret);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment