mtd: spi-nor: core: rework struct spi_nor_erase_region
authorTakahiro Kuwano <Takahiro.Kuwano@infineon.com>
Tue, 20 Feb 2024 08:34:06 +0000 (17:34 +0900)
committerTudor Ambarus <tudor.ambarus@linaro.org>
Mon, 26 Feb 2024 10:35:05 +0000 (12:35 +0200)
commit0e164238bb0752e341f01639438c35822d4488b2
tree8a59d5df8530dfcd300d96e83bca6fcbdadf0156
parenta956502aa844a20a794a47f76c0f760f593fc97a
mtd: spi-nor: core: rework struct spi_nor_erase_region

Encoding bitmask flags into offset worsen the code readability. The
erase type mask and flags should be stored in dedicated members. Also,
erase_map.uniform_erase_type can be removed as it is redundant.

Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Suggested-by: Michael Walle <mwalle@kernel.org>
Reviewed-by: Michael Walle <mwalle@kernel.org>
Link: https://lore.kernel.org/r/8e5e9e4081ed9f16ea9dce30693304a4b54d19b1.1708404584.git.Takahiro.Kuwano@infineon.com
[ta: remove spi_nor_region_end()]
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