mtd: spi-nor: Fix address width on flash chips > 16MB
authorBert Vermeulen <bert@biot.com>
Tue, 6 Oct 2020 13:23:46 +0000 (15:23 +0200)
committerVignesh Raghavendra <vigneshr@ti.com>
Wed, 28 Oct 2020 17:07:55 +0000 (22:37 +0530)
commit324f78dfb442b82365548b657ec4e6974c677502
tree03bbaae7df813b29d28d78de8510b142ef4f7a82
parent69a8eed58cc09aea3b01a64997031dd5d3c02c07
mtd: spi-nor: Fix address width on flash chips > 16MB

If a flash chip has more than 16MB capacity but its BFPT reports
BFPT_DWORD1_ADDRESS_BYTES_3_OR_4, the spi-nor framework defaults to 3.

The check in spi_nor_set_addr_width() doesn't catch it because addr_width
did get set. This fixes that check.

Fixes: f9acd7fa80be ("mtd: spi-nor: sfdp: default to addr_width of 3 for configurable widths")
Signed-off-by: Bert Vermeulen <bert@biot.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Tested-by: Joel Stanley <joel@jms.id.au>
Tested-by: Cédric Le Goater <clg@kaod.org>
Link: https://lore.kernel.org/r/20201006132346.12652-1-bert@biot.com
drivers/mtd/spi-nor/core.c