mtd: nand: Fix a couple error codes
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 4 Apr 2017 08:15:46 +0000 (11:15 +0300)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Tue, 25 Apr 2017 12:18:39 +0000 (14:18 +0200)
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>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
drivers/mtd/nand/atmel/nand-controller.c

index 80e2459f92f81ff40ab6fa52dbe17c38ebc22533..c11f358c6df69c5a96161e1ae8e1bdbd4261bfb3 100644 (file)
@@ -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;
        }