public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] mtd: rawnand: toshiba: Pass a single nand_chip object to the status helper
@ 2018-09-24  9:35 Miquel Raynal
  2018-09-27  9:17 ` Boris Brezillon
  2018-10-05 14:35 ` Miquel Raynal
  0 siblings, 2 replies; 3+ messages in thread
From: Miquel Raynal @ 2018-09-24  9:35 UTC (permalink / raw)
  To: Boris Brezillon, Richard Weinberger, David Woodhouse,
	Brian Norris, Marek Vasut
  Cc: linux-mtd, Miquel Raynal

Now that most of the raw NAND API is consistent and has almost all its
helpers and hooks using a single nand_chip object instead of an mtd_info
one (or both), let's do the same cleanup in the raw NAND vendors
drivers.

Apply this change to the Toshiba driver so that the internal helper to
retrieve the ECC status does only take a nand_chip object.

Suggested-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/nand_toshiba.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/raw/nand_toshiba.c b/drivers/mtd/nand/raw/nand_toshiba.c
index 941ddc615190..0549c4b59d9c 100644
--- a/drivers/mtd/nand/raw/nand_toshiba.c
+++ b/drivers/mtd/nand/raw/nand_toshiba.c
@@ -23,9 +23,9 @@
 /* Recommended to rewrite for BENAND */
 #define TOSHIBA_NAND_STATUS_REWRITE_RECOMMENDED	BIT(3)
 
-static int toshiba_nand_benand_eccstatus(struct mtd_info *mtd,
-					 struct nand_chip *chip)
+static int toshiba_nand_benand_eccstatus(struct nand_chip *chip)
 {
+	struct mtd_info *mtd = nand_to_mtd(chip);
 	int ret;
 	unsigned int max_bitflips = 0;
 	u8 status;
@@ -58,7 +58,7 @@ toshiba_nand_read_page_benand(struct nand_chip *chip, uint8_t *buf,
 	if (ret)
 		return ret;
 
-	return toshiba_nand_benand_eccstatus(mtd, chip);
+	return toshiba_nand_benand_eccstatus(chip);
 }
 
 static int
@@ -73,7 +73,7 @@ toshiba_nand_read_subpage_benand(struct nand_chip *chip, uint32_t data_offs,
 	if (ret)
 		return ret;
 
-	return toshiba_nand_benand_eccstatus(mtd, chip);
+	return toshiba_nand_benand_eccstatus(chip);
 }
 
 static void toshiba_nand_benand_init(struct nand_chip *chip)
-- 
2.17.1

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

* Re: [PATCH] mtd: rawnand: toshiba: Pass a single nand_chip object to the status helper
  2018-09-24  9:35 [PATCH] mtd: rawnand: toshiba: Pass a single nand_chip object to the status helper Miquel Raynal
@ 2018-09-27  9:17 ` Boris Brezillon
  2018-10-05 14:35 ` Miquel Raynal
  1 sibling, 0 replies; 3+ messages in thread
From: Boris Brezillon @ 2018-09-27  9:17 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Richard Weinberger, David Woodhouse, Brian Norris, Marek Vasut,
	linux-mtd

On Mon, 24 Sep 2018 11:35:18 +0200
Miquel Raynal <miquel.raynal@bootlin.com> wrote:

> Now that most of the raw NAND API is consistent and has almost all its
> helpers and hooks using a single nand_chip object instead of an mtd_info
> one (or both), let's do the same cleanup in the raw NAND vendors
> drivers.
> 
> Apply this change to the Toshiba driver so that the internal helper to
> retrieve the ECC status does only take a nand_chip object.
> 
> Suggested-by: Boris Brezillon <boris.brezillon@bootlin.com>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>

> ---
>  drivers/mtd/nand/raw/nand_toshiba.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mtd/nand/raw/nand_toshiba.c b/drivers/mtd/nand/raw/nand_toshiba.c
> index 941ddc615190..0549c4b59d9c 100644
> --- a/drivers/mtd/nand/raw/nand_toshiba.c
> +++ b/drivers/mtd/nand/raw/nand_toshiba.c
> @@ -23,9 +23,9 @@
>  /* Recommended to rewrite for BENAND */
>  #define TOSHIBA_NAND_STATUS_REWRITE_RECOMMENDED	BIT(3)
>  
> -static int toshiba_nand_benand_eccstatus(struct mtd_info *mtd,
> -					 struct nand_chip *chip)
> +static int toshiba_nand_benand_eccstatus(struct nand_chip *chip)
>  {
> +	struct mtd_info *mtd = nand_to_mtd(chip);
>  	int ret;
>  	unsigned int max_bitflips = 0;
>  	u8 status;
> @@ -58,7 +58,7 @@ toshiba_nand_read_page_benand(struct nand_chip *chip, uint8_t *buf,
>  	if (ret)
>  		return ret;
>  
> -	return toshiba_nand_benand_eccstatus(mtd, chip);
> +	return toshiba_nand_benand_eccstatus(chip);
>  }
>  
>  static int
> @@ -73,7 +73,7 @@ toshiba_nand_read_subpage_benand(struct nand_chip *chip, uint32_t data_offs,
>  	if (ret)
>  		return ret;
>  
> -	return toshiba_nand_benand_eccstatus(mtd, chip);
> +	return toshiba_nand_benand_eccstatus(chip);
>  }
>  
>  static void toshiba_nand_benand_init(struct nand_chip *chip)

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

* Re: [PATCH] mtd: rawnand: toshiba: Pass a single nand_chip object to the status helper
  2018-09-24  9:35 [PATCH] mtd: rawnand: toshiba: Pass a single nand_chip object to the status helper Miquel Raynal
  2018-09-27  9:17 ` Boris Brezillon
@ 2018-10-05 14:35 ` Miquel Raynal
  1 sibling, 0 replies; 3+ messages in thread
From: Miquel Raynal @ 2018-10-05 14:35 UTC (permalink / raw)
  To: Boris Brezillon, Richard Weinberger, David Woodhouse,
	Brian Norris, Marek Vasut
  Cc: linux-mtd


Miquel Raynal <miquel.raynal@bootlin.com> wrote on Mon, 24 Sep 2018
11:35:18 +0200:

> Now that most of the raw NAND API is consistent and has almost all its
> helpers and hooks using a single nand_chip object instead of an mtd_info
> one (or both), let's do the same cleanup in the raw NAND vendors
> drivers.
> 
> Apply this change to the Toshiba driver so that the internal helper to
> retrieve the ECC status does only take a nand_chip object.
> 
> Suggested-by: Boris Brezillon <boris.brezillon@bootlin.com>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---

Applied to nand/next.

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

end of thread, other threads:[~2018-10-05 14:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-24  9:35 [PATCH] mtd: rawnand: toshiba: Pass a single nand_chip object to the status helper Miquel Raynal
2018-09-27  9:17 ` Boris Brezillon
2018-10-05 14:35 ` Miquel Raynal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox