diff mbox

mtd: nand: Fix a couple error codes

Message ID 20170404081545.GA25533@mwanda
State Accepted
Commit 70106ddaf31150a57dc00b3d7d5167f693b521ef
Headers show

Commit Message

Dan Carpenter April 4, 2017, 8:15 a.m. UTC
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>

Comments

Marek Vasut April 4, 2017, 9:27 a.m. UTC | #1
On 04/04/2017 10:15 AM, Dan Carpenter wrote:
> 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>

Nice, thanks!

Acked-by: Marek Vasut <marek.vasut@gmail.com>

> 
> diff --git a/drivers/mtd/nand/atmel/nand-controller.c b/drivers/mtd/nand/atmel/nand-controller.c
> index 27301603f394..b8d17a024dbd 100644
> --- a/drivers/mtd/nand/atmel/nand-controller.c
> +++ b/drivers/mtd/nand/atmel/nand-controller.c
> @@ -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;
>  	}
>
Boris Brezillon April 9, 2017, 2:33 p.m. UTC | #2
Hi Dan,

On Tue, 4 Apr 2017 11:15:46 +0300
Dan Carpenter <dan.carpenter@oracle.com> wrote:

> 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

> 
> Fixes: 07b23e3db9ed ("mtd: nand: Cleanup/rework the atmel_nand driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/mtd/nand/atmel/nand-controller.c b/drivers/mtd/nand/atmel/nand-controller.c
> index 27301603f394..b8d17a024dbd 100644
> --- a/drivers/mtd/nand/atmel/nand-controller.c
> +++ b/drivers/mtd/nand/atmel/nand-controller.c
> @@ -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;
>  	}
Dan Carpenter April 10, 2017, 7:09 a.m. UTC | #3
On Sun, Apr 09, 2017 at 04:33:22PM +0200, Boris Brezillon wrote:
> Hi Dan,
> 
> On Tue, 4 Apr 2017 11:15:46 +0300
> Dan Carpenter <dan.carpenter@oracle.com> wrote:
> 
> > 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
Boris Brezillon April 11, 2017, 8:09 a.m. UTC | #4
On Mon, 10 Apr 2017 10:09:43 +0300
Dan Carpenter <dan.carpenter@oracle.com> wrote:

> On Sun, Apr 09, 2017 at 04:33:22PM +0200, Boris Brezillon wrote:
> > Hi Dan,
> > 
> > On Tue, 4 Apr 2017 11:15:46 +0300
> > Dan Carpenter <dan.carpenter@oracle.com> wrote:
> >   
> > > 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.

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 April 11, 2017, 11:37 a.m. UTC | #5
On Tue, 4 Apr 2017 11:15:46 +0300
Dan Carpenter <dan.carpenter@oracle.com> wrote:

> We accidentally return 1 on error instead of proper error codes.
> 

Applied.

Thanks,

Boris

> Fixes: 07b23e3db9ed ("mtd: nand: Cleanup/rework the atmel_nand driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/mtd/nand/atmel/nand-controller.c b/drivers/mtd/nand/atmel/nand-controller.c
> index 27301603f394..b8d17a024dbd 100644
> --- a/drivers/mtd/nand/atmel/nand-controller.c
> +++ b/drivers/mtd/nand/atmel/nand-controller.c
> @@ -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;
>  	}
diff mbox

Patch

diff --git a/drivers/mtd/nand/atmel/nand-controller.c b/drivers/mtd/nand/atmel/nand-controller.c
index 27301603f394..b8d17a024dbd 100644
--- a/drivers/mtd/nand/atmel/nand-controller.c
+++ b/drivers/mtd/nand/atmel/nand-controller.c
@@ -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;
 	}