Skip to content

Commit

Permalink
mtd: introduce a macro for max NAND ID sequence length
Browse files Browse the repository at this point in the history
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]>
Acked-by: Huang Shijie <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
  • Loading branch information
dedekind authored and David Woodhouse committed Apr 5, 2013
1 parent ecb42fe commit 53552d2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/linux/mtd/nand.h
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,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
Expand Down Expand Up @@ -593,7 +596,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;
Expand Down

0 comments on commit 53552d2

Please sign in to comment.