Skip to content

Commit 440b6d5

Browse files
r-vigneshmiquelraynal
authored andcommitted
mtd: spi-nor: Fix selection of 4-byte addressing opcodes on Spansion
mtd->size is still unassigned when running spansion_post_sfdp_fixups() hook, therefore use nor->params.size to determine the size of flash device. This makes sure that 4-byte addressing opcodes are used on Spansion flashes that are larger than 16MiB and don't have SFDP 4BAIT table populated. Fixes: 92094eb ("mtd: spi-nor: Add spansion_post_sfdp_fixups()") Signed-off-by: Vignesh Raghavendra <[email protected]> Reviewed-by: Tudor Ambarus <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
1 parent b3a987b commit 440b6d5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/mtd/spi-nor/spi-nor.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4769,9 +4769,7 @@ static void spi_nor_info_init_params(struct spi_nor *nor)
47694769

47704770
static void spansion_post_sfdp_fixups(struct spi_nor *nor)
47714771
{
4772-
struct mtd_info *mtd = &nor->mtd;
4773-
4774-
if (mtd->size <= SZ_16M)
4772+
if (nor->params.size <= SZ_16M)
47754773
return;
47764774

47774775
nor->flags |= SNOR_F_4B_OPCODES;

0 commit comments

Comments
 (0)