summaryrefslogtreecommitdiff
path: root/drivers/mtd/nand
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2023-01-12 12:36:36 +0300
committerMiquel Raynal <miquel.raynal@bootlin.com>2023-01-13 19:35:49 +0300
commitb1f9ffbfda07acee9bdbc77416facf606647b523 (patch)
tree461e3a5aed4845a8413002e552a5321ea4858380 /drivers/mtd/nand
parent9f820fc0651c32f8dde26b8e3ad93e1b9fdb62c4 (diff)
downloadlinux-b1f9ffbfda07acee9bdbc77416facf606647b523.tar.xz
mtd: rawnand: Prepare the late addition of supported operation checks
Add an empty envelope just to show how to add additional checks for new operations. This is going to be used for sequential cached reads, which require the page size to be known (and the discovery to be over), hence the "late" designation. 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-3-miquel.raynal@bootlin.com
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r--drivers/mtd/nand/raw/nand_base.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
index 7b87e2e70484..e1f74e2fa415 100644
--- a/drivers/mtd/nand/raw/nand_base.c
+++ b/drivers/mtd/nand/raw/nand_base.c
@@ -5009,6 +5009,14 @@ static void rawnand_early_check_supported_ops(struct nand_chip *chip)
rawnand_check_data_only_read_support(chip);
}
+static void rawnand_late_check_supported_ops(struct nand_chip *chip)
+{
+ /* The supported_op fields should not be set by individual drivers */
+
+ if (!nand_has_exec_op(chip))
+ return;
+}
+
/*
* Get the flash and manufacturer id and lookup if the type is supported.
*/
@@ -6345,6 +6353,8 @@ static int nand_scan_tail(struct nand_chip *chip)
goto err_free_interface_config;
}
+ rawnand_late_check_supported_ops(chip);
+
/*
* Look for secure regions in the NAND chip. These regions are supposed
* to be protected by a secure element like Trustzone. So the read/write