Skip to contentSkip to conversation

mtd: nand: Fix a couple error codes

PATCH Applied Dan Carpenter 3 participants 6 messages Apr 4, 2017 – Apr 11, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
drivers/mtd/nand/atmel/nand-controller.c +2 -2
index 27301603f394..b8d17a024dbd 100644
@@ -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;
 	}
Acked-by on v1 1/1
#1 lore raw
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")

Nice, thanks!

Quoted 24 lines
drivers/mtd/nand/atmel/nand-controller.c +2 -2
index 27301603f394..b8d17a024dbd 100644
@@ -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
#2 lore raw
In reply to Dan Carpenter

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")
drivers/mtd/nand/atmel/nand-controller.c +2 -2
index 27301603f394..b8d17a024dbd 100644
@@ -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;
 	}
#3 lore raw
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

#4 lore raw
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

#5 lore raw
In reply to Dan Carpenter
Quoted 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")
drivers/mtd/nand/atmel/nand-controller.c +2 -2
index 27301603f394..b8d17a024dbd 100644
@@ -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;
 	}