Linux-mtd Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] mtd: rawnand: gpmi: Introduce GPMI_IS_MXS() macro
@ 2019-02-07 10:50 Fabio Estevam
  2019-02-07 11:01 ` Miquel Raynal
  2019-04-01 15:22 ` Miquel Raynal
  0 siblings, 2 replies; 4+ messages in thread
From: Fabio Estevam @ 2019-02-07 10:50 UTC (permalink / raw)
  To: bbrezillon
  Cc: han.xu, martin.kepplinger, linux-mtd, Fabio Estevam, miquel.raynal

Introduce a GPMI_IS_MXS() macro to take into account the cases
when mx23 or mx28 are used, which helps readability.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c  | 6 ++----
 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 2 +-
 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.h | 1 +
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
index a4768df5083f..a8b26d2e793c 100644
--- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
+++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
@@ -157,8 +157,7 @@ int gpmi_init(struct gpmi_nand_data *this)
 	 * Reset BCH here, too. We got failures otherwise :(
 	 * See later BCH reset for explanation of MX23 and MX28 handling
 	 */
-	ret = gpmi_reset_block(r->bch_regs,
-			       GPMI_IS_MX23(this) || GPMI_IS_MX28(this));
+	ret = gpmi_reset_block(r->bch_regs, GPMI_IS_MXS(this));
 	if (ret)
 		goto err_out;
 
@@ -266,8 +265,7 @@ int bch_set_geometry(struct gpmi_nand_data *this)
 	* chip, otherwise it will lock up. So we skip resetting BCH on the MX23.
 	* and MX28.
 	*/
-	ret = gpmi_reset_block(r->bch_regs,
-			       GPMI_IS_MX23(this) || GPMI_IS_MX28(this));
+	ret = gpmi_reset_block(r->bch_regs, GPMI_IS_MXS(this));
 	if (ret)
 		goto err_out;
 
diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
index ed405c9434fe..bcf5328cf239 100644
--- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
@@ -171,7 +171,7 @@ static inline bool gpmi_check_ecc(struct gpmi_nand_data *this)
 	struct bch_geometry *geo = &this->bch_geometry;
 
 	/* Do the sanity check. */
-	if (GPMI_IS_MX23(this) || GPMI_IS_MX28(this)) {
+	if (GPMI_IS_MXS(this)) {
 		/* The mx23/mx28 only support the GF13. */
 		if (geo->gf_len == 14)
 			return false;
diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.h b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.h
index d0b79bac2728..a804a4a5bd46 100644
--- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.h
+++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.h
@@ -207,4 +207,5 @@ void gpmi_copy_bits(u8 *dst, size_t dst_bit_off,
 
 #define GPMI_IS_MX6(x)		(GPMI_IS_MX6Q(x) || GPMI_IS_MX6SX(x) || \
 				 GPMI_IS_MX7D(x))
+#define GPMI_IS_MXS(x)		(GPMI_IS_MX23(x) || GPMI_IS_MX28(x))
 #endif
-- 
2.17.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH] mtd: rawnand: gpmi: Introduce GPMI_IS_MXS() macro
  2019-02-07 10:50 [PATCH] mtd: rawnand: gpmi: Introduce GPMI_IS_MXS() macro Fabio Estevam
@ 2019-02-07 11:01 ` Miquel Raynal
  2019-02-07 11:29   ` Fabio Estevam
  2019-04-01 15:22 ` Miquel Raynal
  1 sibling, 1 reply; 4+ messages in thread
From: Miquel Raynal @ 2019-02-07 11:01 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: han.xu, martin.kepplinger, linux-mtd, bbrezillon

Hi Fabio,

Fabio Estevam <festevam@gmail.com> wrote on Thu,  7 Feb 2019 08:50:54
-0200:

> Introduce a GPMI_IS_MXS() macro to take into account the cases
> when mx23 or mx28 are used, which helps readability.
> 
> Signed-off-by: Fabio Estevam <festevam@gmail.com>
> ---
>  drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c  | 6 ++----
>  drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 2 +-
>  drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.h | 1 +
>  3 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
> index a4768df5083f..a8b26d2e793c 100644
> --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
> +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
> @@ -157,8 +157,7 @@ int gpmi_init(struct gpmi_nand_data *this)
>  	 * Reset BCH here, too. We got failures otherwise :(
>  	 * See later BCH reset for explanation of MX23 and MX28 handling
>  	 */
> -	ret = gpmi_reset_block(r->bch_regs,
> -			       GPMI_IS_MX23(this) || GPMI_IS_MX28(this));
> +	ret = gpmi_reset_block(r->bch_regs, GPMI_IS_MXS(this));
>  	if (ret)
>  		goto err_out;
>  
> @@ -266,8 +265,7 @@ int bch_set_geometry(struct gpmi_nand_data *this)
>  	* chip, otherwise it will lock up. So we skip resetting BCH on the MX23.
>  	* and MX28.
>  	*/
> -	ret = gpmi_reset_block(r->bch_regs,
> -			       GPMI_IS_MX23(this) || GPMI_IS_MX28(this));
> +	ret = gpmi_reset_block(r->bch_regs, GPMI_IS_MXS(this));
>  	if (ret)
>  		goto err_out;
>  
> diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> index ed405c9434fe..bcf5328cf239 100644
> --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> @@ -171,7 +171,7 @@ static inline bool gpmi_check_ecc(struct gpmi_nand_data *this)
>  	struct bch_geometry *geo = &this->bch_geometry;
>  
>  	/* Do the sanity check. */
> -	if (GPMI_IS_MX23(this) || GPMI_IS_MX28(this)) {
> +	if (GPMI_IS_MXS(this)) {
>  		/* The mx23/mx28 only support the GF13. */
>  		if (geo->gf_len == 14)
>  			return false;
> diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.h b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.h
> index d0b79bac2728..a804a4a5bd46 100644
> --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.h
> +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.h
> @@ -207,4 +207,5 @@ void gpmi_copy_bits(u8 *dst, size_t dst_bit_off,
>  
>  #define GPMI_IS_MX6(x)		(GPMI_IS_MX6Q(x) || GPMI_IS_MX6SX(x) || \
>  				 GPMI_IS_MX7D(x))
> +#define GPMI_IS_MXS(x)		(GPMI_IS_MX23(x) || GPMI_IS_MX28(x))
>  #endif

I'm fine with the patch but as this depends on the fix Boris just took I
will apply it for 5.2.


Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH] mtd: rawnand: gpmi: Introduce GPMI_IS_MXS() macro
  2019-02-07 11:01 ` Miquel Raynal
@ 2019-02-07 11:29   ` Fabio Estevam
  0 siblings, 0 replies; 4+ messages in thread
From: Fabio Estevam @ 2019-02-07 11:29 UTC (permalink / raw)
  To: Miquel Raynal; +Cc: Han Xu, Martin Kepplinger, linux-mtd, bbrezillon

Hi Miquel,

On Thu, Feb 7, 2019 at 9:01 AM Miquel Raynal <miquel.raynal@bootlin.com> wrote:

> I'm fine with the patch but as this depends on the fix Boris just took I
> will apply it for 5.2.

That works, thanks.

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH] mtd: rawnand: gpmi: Introduce GPMI_IS_MXS() macro
  2019-02-07 10:50 [PATCH] mtd: rawnand: gpmi: Introduce GPMI_IS_MXS() macro Fabio Estevam
  2019-02-07 11:01 ` Miquel Raynal
@ 2019-04-01 15:22 ` Miquel Raynal
  1 sibling, 0 replies; 4+ messages in thread
From: Miquel Raynal @ 2019-04-01 15:22 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: han.xu, martin.kepplinger, linux-mtd, bbrezillon

Hi Fabio,

Fabio Estevam <festevam@gmail.com> wrote on Thu,  7 Feb 2019 08:50:54
-0200:

> Introduce a GPMI_IS_MXS() macro to take into account the cases
> when mx23 or mx28 are used, which helps readability.
> 
> Signed-off-by: Fabio Estevam <festevam@gmail.com>
> ---

Applied to git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git
on nand/next.

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-07 10:50 [PATCH] mtd: rawnand: gpmi: Introduce GPMI_IS_MXS() macro Fabio Estevam
2019-02-07 11:01 ` Miquel Raynal
2019-02-07 11:29   ` Fabio Estevam
2019-04-01 15:22 ` Miquel Raynal

Linux-mtd Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mtd/0 linux-mtd/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mtd linux-mtd/ https://lore.kernel.org/linux-mtd \
		linux-mtd@lists.infradead.org linux-mtd@archiver.kernel.org
	public-inbox-index linux-mtd


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-mtd


AGPL code for this site: git clone https://public-inbox.org/ public-inbox