Skip to content

Commit

Permalink
mtd: spi-nor: Fix selection of 4-byte addressing opcodes on Spansion
Browse files Browse the repository at this point in the history
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 <vigneshr@ti.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
  • Loading branch information
Vignesh Raghavendra authored and Miquel Raynal committed Jan 17, 2020
1 parent b3a987b commit 440b6d5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/mtd/spi-nor/spi-nor.c
Original file line number Diff line number Diff line change
Expand Up @@ -4769,9 +4769,7 @@ static void spi_nor_info_init_params(struct spi_nor *nor)

static void spansion_post_sfdp_fixups(struct spi_nor *nor)
{
struct mtd_info *mtd = &nor->mtd;

if (mtd->size <= SZ_16M)
if (nor->params.size <= SZ_16M)
return;

nor->flags |= SNOR_F_4B_OPCODES;
Expand Down

0 comments on commit 440b6d5

Please sign in to comment.