projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6e9c65d
)
mtd: rawnand: jedec: Define the number of parameter pages
author
Miquel Raynal
<miquel.raynal@bootlin.com>
Tue, 28 Apr 2020 09:43:01 +0000
(11:43 +0200)
committer
Miquel Raynal
<miquel.raynal@bootlin.com>
Mon, 11 May 2020 07:51:40 +0000
(09:51 +0200)
Use a macro to define the number of parameter page instead of
hardcoding it everywhere.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link:
https://lore.kernel.org/linux-mtd/20200428094302.14624-9-miquel.raynal@bootlin.com
drivers/mtd/nand/raw/nand_jedec.c
patch
|
blob
|
history
diff --git
a/drivers/mtd/nand/raw/nand_jedec.c
b/drivers/mtd/nand/raw/nand_jedec.c
index 9b540e76f84f5202af09c0b3028d1b79399aaf55..0cd322a8be242d648e0a8017375cd814f5bbbb54 100644
(file)
--- a/
drivers/mtd/nand/raw/nand_jedec.c
+++ b/
drivers/mtd/nand/raw/nand_jedec.c
@@
-16,6
+16,8
@@
#include "internals.h"
+#define JEDEC_PARAM_PAGES 3
+
/*
* Check if the NAND chip is JEDEC compliant, returns 1 if it is, 0 otherwise.
*/
@@
-47,7
+49,7
@@
int nand_jedec_detect(struct nand_chip *chip)
goto free_jedec_param_page;
}
- for (i = 0; i <
3
; i++) {
+ for (i = 0; i <
JEDEC_PARAM_PAGES
; i++) {
ret = nand_read_data_op(chip, p, sizeof(*p), true);
if (ret) {
ret = 0;
@@
-59,7
+61,7
@@
int nand_jedec_detect(struct nand_chip *chip)
break;
}
- if (i ==
3
) {
+ if (i ==
JEDEC_PARAM_PAGES
) {
pr_err("Could not find valid JEDEC parameter page; aborting\n");
goto free_jedec_param_page;
}