summaryrefslogtreecommitdiff
path: root/drivers/mtd/nand/raw/nand_onfi.c
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2023-01-12 12:36:35 +0300
committerMiquel Raynal <miquel.raynal@bootlin.com>2023-01-13 19:35:26 +0300
commit9f820fc0651c32f8dde26b8e3ad93e1b9fdb62c4 (patch)
tree6b9d52607b333012ff9e812c91a51e924a1236b3 /drivers/mtd/nand/raw/nand_onfi.c
parent568494db680991d6a09b5ab92dcddb7dfd3cbe25 (diff)
downloadlinux-9f820fc0651c32f8dde26b8e3ad93e1b9fdb62c4.tar.xz
mtd: rawnand: Check the data only read pattern only once
Instead of checking if a pattern is supported each time we need it, let's create a bitfield that only the core would be allowed to fill at startup time. The core and the individual drivers may then use it in order to check what operation they should use. This bitfield is supposed to grow over time. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Tested-by: Liao Jaime <jaimeliao.tw@gmail.com> Link: https://lore.kernel.org/linux-mtd/20230112093637.987838-2-miquel.raynal@bootlin.com
Diffstat (limited to 'drivers/mtd/nand/raw/nand_onfi.c')
-rw-r--r--drivers/mtd/nand/raw/nand_onfi.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/mtd/nand/raw/nand_onfi.c b/drivers/mtd/nand/raw/nand_onfi.c
index 7586befce7f9..f15ef90aec8c 100644
--- a/drivers/mtd/nand/raw/nand_onfi.c
+++ b/drivers/mtd/nand/raw/nand_onfi.c
@@ -166,8 +166,7 @@ int nand_onfi_detect(struct nand_chip *chip)
if (!pbuf)
return -ENOMEM;
- if (!nand_has_exec_op(chip) ||
- !nand_read_data_op(chip, &pbuf[0], sizeof(*pbuf), true, true))
+ if (!nand_has_exec_op(chip) || chip->controller->supported_op.data_only_read)
use_datain = true;
for (i = 0; i < ONFI_PARAM_PAGES; i++) {