mtd: spi-nor: Fix selection of 4-byte addressing opcodes on Spansion
authorVignesh Raghavendra <vigneshr@ti.com>
Wed, 8 Jan 2020 05:13:43 +0000 (10:43 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Jan 2020 07:22:38 +0000 (08:22 +0100)
commit144573be2633f6b144adb103080acd20b9eeca4e
treeb5595788cd2c453f450b5b89fdc4488c8a88bca8
parentf6e4244f8b45da63c7a24096f17368f5a531df56
mtd: spi-nor: Fix selection of 4-byte addressing opcodes on Spansion

commit 440b6d50254bdbd84c2a665c7f53ec69dd741a4f upstream.

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: 92094ebc385e ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mtd/spi-nor/spi-nor.c