All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: nand: Fix nanddev_mtd_erase()
@ 2018-04-10 15:15 Boris Brezillon
  2018-04-24 15:46 ` Boris Brezillon
  0 siblings, 1 reply; 2+ messages in thread
From: Boris Brezillon @ 2018-04-10 15:15 UTC (permalink / raw)
  To: Boris Brezillon, Richard Weinberger, Miquel Raynal, linux-mtd
  Cc: David Woodhouse, Brian Norris, Marek Vasut, Cyrille Pitchen

Commit e7bfb3fdbde3 ("mtd: Stop updating erase_info->state and calling
mtd_erase_callback()") removed the einfo->state field and the
MTD_ERASE_XXX macros. At the same time, the generic NAND layer was added
and made sure to update the erase info state.

It did not result in a build failure after merging the nand/for-4.17
branch in mtd/next because the generic NAND layer is not selected yet.
Let's fix that before a config option starts selecting MTD_NAND_CORE.

Fixes: e7bfb3fdbde3 ("mtd: Stop updating erase_info->state and calling mtd_erase_callback()")
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
---
 drivers/mtd/nand/core.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/mtd/nand/core.c b/drivers/mtd/nand/core.c
index d0cd6f8635d7..9c9f8936b63b 100644
--- a/drivers/mtd/nand/core.c
+++ b/drivers/mtd/nand/core.c
@@ -162,7 +162,6 @@ int nanddev_mtd_erase(struct mtd_info *mtd, struct erase_info *einfo)
 		ret = nanddev_erase(nand, &pos);
 		if (ret) {
 			einfo->fail_addr = nanddev_pos_to_offs(nand, &pos);
-			einfo->state = MTD_ERASE_FAILED;
 
 			return ret;
 		}
@@ -170,8 +169,6 @@ int nanddev_mtd_erase(struct mtd_info *mtd, struct erase_info *einfo)
 		nanddev_pos_next_eraseblock(nand, &pos);
 	}
 
-	einfo->state = MTD_ERASE_DONE;
-
 	return 0;
 }
 EXPORT_SYMBOL_GPL(nanddev_mtd_erase);
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mtd: nand: Fix nanddev_mtd_erase()
  2018-04-10 15:15 [PATCH] mtd: nand: Fix nanddev_mtd_erase() Boris Brezillon
@ 2018-04-24 15:46 ` Boris Brezillon
  0 siblings, 0 replies; 2+ messages in thread
From: Boris Brezillon @ 2018-04-24 15:46 UTC (permalink / raw)
  To: Boris Brezillon, Richard Weinberger, Miquel Raynal, linux-mtd
  Cc: Marek Vasut, Brian Norris, David Woodhouse, Cyrille Pitchen

On Tue, 10 Apr 2018 17:15:13 +0200
Boris Brezillon <boris.brezillon@bootlin.com> wrote:

> Commit e7bfb3fdbde3 ("mtd: Stop updating erase_info->state and calling
> mtd_erase_callback()") removed the einfo->state field and the
> MTD_ERASE_XXX macros. At the same time, the generic NAND layer was added
> and made sure to update the erase info state.
> 
> It did not result in a build failure after merging the nand/for-4.17
> branch in mtd/next because the generic NAND layer is not selected yet.
> Let's fix that before a config option starts selecting MTD_NAND_CORE.
> 
> Fixes: e7bfb3fdbde3 ("mtd: Stop updating erase_info->state and calling mtd_erase_callback()")
> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>

Applied to master.

> ---
>  drivers/mtd/nand/core.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/mtd/nand/core.c b/drivers/mtd/nand/core.c
> index d0cd6f8635d7..9c9f8936b63b 100644
> --- a/drivers/mtd/nand/core.c
> +++ b/drivers/mtd/nand/core.c
> @@ -162,7 +162,6 @@ int nanddev_mtd_erase(struct mtd_info *mtd, struct erase_info *einfo)
>  		ret = nanddev_erase(nand, &pos);
>  		if (ret) {
>  			einfo->fail_addr = nanddev_pos_to_offs(nand, &pos);
> -			einfo->state = MTD_ERASE_FAILED;
>  
>  			return ret;
>  		}
> @@ -170,8 +169,6 @@ int nanddev_mtd_erase(struct mtd_info *mtd, struct erase_info *einfo)
>  		nanddev_pos_next_eraseblock(nand, &pos);
>  	}
>  
> -	einfo->state = MTD_ERASE_DONE;
> -
>  	return 0;
>  }
>  EXPORT_SYMBOL_GPL(nanddev_mtd_erase);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-24 15:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-10 15:15 [PATCH] mtd: nand: Fix nanddev_mtd_erase() Boris Brezillon
2018-04-24 15:46 ` Boris Brezillon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.