mtd: nand: Fix a couple error codes
Subsystems (4)
PATCH 1/1 mtd: nand: Fix a couple error codes
We accidentally return 1 on error instead of proper error codes.
drivers/mtd/nand/atmel/nand-controller.c +2 -2
@@ -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; }
Quoted 4 lines · Dan Carpenter
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 <[email protected]>
Nice, thanks!
Quoted 24 lines
drivers/mtd/nand/atmel/nand-controller.c +2
-2@@ -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; }
Signature · 2 lines
Best regards, Marek Vasut
Hi Dan,
Quoted 1 line · On Tue, 4 Apr 2017 11:15:46 +0300 Dan Carpenter <[email protected]>…
We accidentally return 1 on error instead of proper error codes.
These bugs have not reached Linus' tree yet and I'll have to force push my nand/next branch because of regressions introduced by other patches (not related to the Atmel NAND driver rework). Do you mind if I squash the changes in the original commit?
Thanks,
Boris
Quoted 26 lines
Fixes 07b23e3db9ed ("mtd: nand: Cleanup/rework the atmel_nand driver")Signed-off-by Dan Carpenter <[email protected]>drivers/mtd/nand/atmel/nand-controller.c +2
-2@@ -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; }
Quoted 5 lines · Boris Brezillon
Hi Dan,
On Tue, 4 Apr 2017 11:15:46 +0300
Dan Carpenter <[email protected]> wrote:
Quoted 7 lines
Quoted 1 line
We accidentally return 1 on error instead of proper error codes.
These bugs have not reached Linus' tree yet and I'll have to force push my nand/next branch because of regressions introduced by other patches (not related to the Atmel NAND driver rework). Do you mind if I squash the changes in the original commit?
No problem. I'm lobying for a Fixes-from: tag for this, (which would not cover style issues), but it's not an official tag yet.
regards,
dan carpenter
Quoted 8 lines · On Mon, 10 Apr 2017 10:09:43 +0300 Dan Carpenter <[email protected]>…
Quoted 7 lines · Boris Brezillon
Hi Dan,
Quoted 1 line · On Tue, 4 Apr 2017 11:15:46 +0300 Dan Carpenter <[email protected]>…
We accidentally return 1 on error instead of proper error codes.
Quoted 8 lines
Quoted 5 lines
These bugs have not reached Linus' tree yet and I'll have to force push my nand/next branch because of regressions introduced by other patches (not related to the Atmel NAND driver rework). Do you mind if I squash the changes in the original commit?
No problem. I'm lobying for a Fixes-from: tag for this, (which would not cover style issues), but it's not an official tag yet.
Never mind. Another bug as been reported/fixed in the same driver, so I'll just pick your patch as is instead of merging the changes in the initial commit.
Thanks,
Boris
Boris Brezillon
AppliedQuoted 2 lines · On Tue, 4 Apr 2017 11:15:46 +0300 Dan Carpenter <[email protected]>…
We accidentally return 1 on error instead of proper error codes.
Applied.
Thanks,
Boris
Quoted 25 lines
Fixes 07b23e3db9ed ("mtd: nand: Cleanup/rework the atmel_nand driver")Signed-off-by Dan Carpenter <[email protected]>drivers/mtd/nand/atmel/nand-controller.c +2
-2@@ -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; }