Skip to content

Commit 53552d2

Browse files
dedekindDavid Woodhouse
authored andcommitted
mtd: introduce a macro for max NAND ID sequence length
Introduce a helpful macro for the maximum NAND ID sequence length instead of using the "8" magic number. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Acked-by: Huang Shijie <shijie8@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
1 parent ecb42fe commit 53552d2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎include/linux/mtd/nand.h‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,9 @@ struct nand_chip {
546546
#define NAND_MFR_MACRONIX 0xc2
547547
#define NAND_MFR_EON 0x92
548548

549+
/* The maximum expected count of bytes in the NAND ID sequence */
550+
#define NAND_MAX_ID_LEN 8
551+
549552
/*
550553
* A helper for defining older NAND chips where the second ID byte fully
551554
* defined the chip, including the geometry (chip size, eraseblock size, page
@@ -593,7 +596,7 @@ struct nand_flash_dev {
593596
uint8_t mfr_id;
594597
uint8_t dev_id;
595598
};
596-
uint8_t id[8];
599+
uint8_t id[NAND_MAX_ID_LEN];
597600
};
598601
unsigned int pagesize;
599602
unsigned int chipsize;

0 commit comments

Comments
 (0)