mtd: spi-nor: Do not change nor->addr_nbytes at SFDP parsing time
authorTudor Ambarus <tudor.ambarus@microchip.com>
Mon, 25 Jul 2022 09:25:01 +0000 (12:25 +0300)
committerTudor Ambarus <tudor.ambarus@microchip.com>
Thu, 28 Jul 2022 02:11:56 +0000 (05:11 +0300)
commit47c6f8a67f2ce1b95202c16fa126411d6f5c7d5c
tree39d89d3ee8fb85b9b6ae34f15029210e10c97e83
parentaa5d980a144cd0bf717eb16609c29ff276f8bd47
mtd: spi-nor: Do not change nor->addr_nbytes at SFDP parsing time

At the SFDP parsing time we should not change members of struct spi_nor,
but instead fill members of struct spi_nor_flash_parameters which could
later on be used by callers. The caller will then decide if SFDP params
should be used and more importantly when they should be used. Clean the
code flow and don't initialize nor->addr_nbytes at SFDP parsing time.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Tested-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Reviewed-by: Michael Walle <michael@walle.cc>
Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
Link: https://lore.kernel.org/r/20220725092505.446315-4-tudor.ambarus@microchip.com
drivers/mtd/spi-nor/core.c
drivers/mtd/spi-nor/core.h
drivers/mtd/spi-nor/issi.c
drivers/mtd/spi-nor/sfdp.c