mtd: spi-nor: core: get rid of SNOR_LAST_REGION flag
authorTakahiro Kuwano <Takahiro.Kuwano@infineon.com>
Tue, 20 Feb 2024 08:34:07 +0000 (17:34 +0900)
committerTudor Ambarus <tudor.ambarus@linaro.org>
Mon, 26 Feb 2024 11:17:43 +0000 (13:17 +0200)
commitdf6e36edac23f096fae45d0a8fe2efcf0e77aebe
treea9f2d4d20ed68b72d68afeb0a797421b58adea7f
parent0e164238bb0752e341f01639438c35822d4488b2
mtd: spi-nor: core: get rid of SNOR_LAST_REGION flag

Introduce n_regions in spi_nor_erase_map structure and remove
SNOR_LAST_REGION flag. Loop logics that depend on the flag are also
reworked to use n_regions as loop condition.

Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Suggested-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Suggested-by: Michael Walle <mwalle@kernel.org>
Reviewed-by: Michael Walle <mwalle@kernel.org>
Link: https://lore.kernel.org/r/eded84294bd81e966d6f423e578fc2cfb9a4a5b6.1708404584.git.Takahiro.Kuwano@infineon.com
[ta: update spi_nor_init_erase_cmd_list() and break the for loop sooner.]
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
drivers/mtd/spi-nor/core.c
drivers/mtd/spi-nor/core.h
drivers/mtd/spi-nor/debugfs.c
drivers/mtd/spi-nor/sfdp.c