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