summaryrefslogtreecommitdiffstats
path: root/include/linux/mtd
diff options
context:
space:
mode:
authorJean-Louis Thekekara <jeanlouis.thekekara@parrot.com>2017-06-29 19:08:30 +0200
committerBoris Brezillon <boris.brezillon@free-electrons.com>2017-08-23 16:49:13 +0200
commit5158bd5597e4c0939db3ecefbcbf492c425e611c (patch)
tree0a4c1e150f26e53033f8955a7e27ceacb547c011 /include/linux/mtd
parentf84674b82af2c3ea68b9032d1244f364e46cc75d (diff)
downloadop-kernel-dev-5158bd5597e4c0939db3ecefbcbf492c425e611c.zip
op-kernel-dev-5158bd5597e4c0939db3ecefbcbf492c425e611c.tar.gz
mtd: nand: remove hard-coded NAND ids length
This commit removes hard-coded '8' used for looping into struct nand_chip.id.data array. NAND_MAX_ID_LEN has been introduced by Artem Bityutskiy in 53552d22bfe1f for defining ids length in nand_flash_ids[] list. This commit unifies ids length in nand base driver. Signed-off-by: Jean-Louis Thekekara <jeanlouis.thekekara@parrot.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Diffstat (limited to 'include/linux/mtd')
-rw-r--r--include/linux/mtd/nand.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 8a6522e..2976840 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -439,14 +439,16 @@ struct nand_jedec_params {
__le16 crc;
} __packed;
+/* The maximum expected count of bytes in the NAND ID sequence */
+#define NAND_MAX_ID_LEN 8
+
/**
* struct nand_id - NAND id structure
- * @data: buffer containing the id bytes. Currently 8 bytes large, but can
- * be extended if required.
+ * @data: buffer containing the id bytes.
* @len: ID length.
*/
struct nand_id {
- u8 data[8];
+ u8 data[NAND_MAX_ID_LEN];
int len;
};
@@ -1018,8 +1020,6 @@ static inline void *nand_get_manufacturer_data(struct nand_chip *chip)
#define NAND_MFR_ATO 0x9b
#define NAND_MFR_WINBOND 0xef
-/* 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
OpenPOWER on IntegriCloud