mtd: rawnand: gpmi: Introduce GPMI_IS_MXS() macro
PATCH 1/1 mtd: rawnand: gpmi: Introduce GPMI_IS_MXS() macro
Introduce a GPMI_IS_MXS() macro to take into account the cases when mx23 or mx28 are used, which helps readability.
--- 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(-)
drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c +2 -4
@@ -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;
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +1 -1
@@ -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;
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.h +1 -0
@@ -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
Signature · 6 lines
2.17.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
Miquel Raynal
maintainerHi Fabio,
Fabio Estevam <[email protected]> wrote on Thu, 7 Feb 2019 08:50:54 -0200:
Quoted 52 lines
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 <[email protected]>--- 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(-)drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c +2
-4@@ -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;drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +1
-1@@ -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;drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.h +0
-0
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.h void gpmi_copy_bits(u8 *dst, size_t dst_bit_off, · line 211
Quoted 5 lines
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.h +1
-0@@ -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/
Hi Miquel,
Quoted 2 lines · Miquel Raynal
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/
Hi Fabio,
Fabio Estevam <[email protected]> wrote on Thu, 7 Feb 2019 08:50:54 -0200:
Quoted 5 lines
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 <[email protected]>---
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/