summaryrefslogtreecommitdiff
path: root/drivers/mtd/spi-nor/swp.c
diff options
context:
space:
mode:
authorMichael Walle <mwalle@kernel.org>2023-09-08 13:16:27 +0300
committerTudor Ambarus <tudor.ambarus@linaro.org>2023-09-19 18:50:01 +0300
commit9b6bb07eadaf2a98a86b6bc1ab4410c72d6ba572 (patch)
tree615c5d9f9932a2ca26af1d7368760125c56b34c2 /drivers/mtd/spi-nor/swp.c
parente255a79162b6fbf3c62f2883ef9ecd66feb10fb6 (diff)
downloadlinux-9b6bb07eadaf2a98a86b6bc1ab4410c72d6ba572.tar.xz
mtd: spi-nor: push 4k SE handling into spi_nor_select_uniform_erase()
4k sector erase sizes are only a thing with uniform erase types. Push the "we want 4k erase sizes" handling into spi_nor_select_uniform_erase(). One might wonder why the former sector_size isn't used anymore. It is because we either search for the largest erase size or if selected through kconfig, the 4k erase size. Now, why is that correct? For this, we have to differentiate between (1) flashes with SFDP and (2) without SFDP. For (1), we just set one (or two if SECT_4K is set) erase types and wanted_size is exactly one of these. For (2) things are a bit more complicated. For flashes which we don't have in our flash_info database, the generic driver is used and sector_size was already 0, which in turn selected the largest erase size. For flashes which had SFDP and an entry in flash_info, sector_size was always the largest sector and thus the largest erase type. Signed-off-by: Michael Walle <mwalle@kernel.org> Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-9-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Diffstat (limited to 'drivers/mtd/spi-nor/swp.c')
0 files changed, 0 insertions, 0 deletions