Skip to content

Commit b1f9ffb

Browse files
committed
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
1 parent 9f820fc commit b1f9ffb

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

drivers/mtd/nand/raw/nand_base.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5009,6 +5009,14 @@ static void rawnand_early_check_supported_ops(struct nand_chip *chip)
50095009
rawnand_check_data_only_read_support(chip);
50105010
}
50115011

5012+
static void rawnand_late_check_supported_ops(struct nand_chip *chip)
5013+
{
5014+
/* The supported_op fields should not be set by individual drivers */
5015+
5016+
if (!nand_has_exec_op(chip))
5017+
return;
5018+
}
5019+
50125020
/*
50135021
* Get the flash and manufacturer id and lookup if the type is supported.
50145022
*/
@@ -6345,6 +6353,8 @@ static int nand_scan_tail(struct nand_chip *chip)
63456353
goto err_free_interface_config;
63466354
}
63476355

6356+
rawnand_late_check_supported_ops(chip);
6357+
63486358
/*
63496359
* Look for secure regions in the NAND chip. These regions are supposed
63506360
* to be protected by a secure element like Trustzone. So the read/write

0 commit comments

Comments
 (0)