mtd: introduce a macro for max NAND ID sequence length
Subsystems (2)
PATCH 1/1 mtd: introduce a macro for max NAND ID sequence length
From: Artem Bityutskiy <[email protected]>
Introduce a helpful macro for the maximum NAND ID sequence length instead of using the "8" magic number.
Signed-off-by Artem Bityutskiy <[email protected]>
--- include/linux/mtd/nand.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
include/linux/mtd/nand.h +4 -1
@@ -542,6 +542,9 @@ struct nand_chip {#define NAND_MFR_MACRONIX 0xc2#define NAND_MFR_EON 0x92 +/* The maximum expected count of bytes in the NAND ID sequence */ +#define NAND_MAX_ID_LEN 8 +/* * A helper for defining older NAND chips where the second ID byte fully * defined the chip, including the geometry (chip size, eraseblock size, page
@@ -589,7 +592,7 @@ struct nand_flash_dev {uint8_t mfr_id;uint8_t dev_id; }; -uint8_t id[8 ]; +uint8_t id[NAND_MAX_ID_LEN ]; };unsigned int pagesize;unsigned int chipsize;
Signature · 1 line
1.7.10.4
Quoted 25 lines · Artem Bityutskiy
From: Artem Bityutskiy<[email protected]>
Introduce a helpful macro for the maximum NAND ID sequence length instead of using the "8" magic number.
Signed-off-by Artem Bityutskiy<[email protected]>--- include/linux/mtd/nand.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)include/linux/mtd/nand.h +3
-0@@ -542,6 +542,9 @@ struct nand_chip {#define NAND_MFR_MACRONIX 0xc2#define NAND_MFR_EON 0x92 +/* The maximum expected count of bytes in the NAND ID sequence */ +#define NAND_MAX_ID_LEN 8 +/* * A helper for defining older NAND chips where the second ID byte fully * defined the chip, including the geometry (chip size, eraseblock size, page
include/linux/mtd/nand.h struct nand_flash_dev { · line 598
Quoted 8 lines
include/linux/mtd/nand.h +1
-1@@ -589,7 +592,7 @@ struct nand_flash_dev {uint8_t mfr_id;uint8_t dev_id; }; -uint8_t id[8 ]; +uint8_t id[NAND_MAX_ID_LEN ]; };unsigned int pagesize;unsigned int chipsize;
I also thought we should add a macro for the length of the id data.
Acked-by Huang Shijie <[email protected]>