mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
mtd: spi-nor: default page_size to 256 bytes
The INFO() macro always set the page_size to 256 bytes. Make that an optional parameter. This default is a sane one for all older flashes, newer ones will set the page size by its SFDP tables anyway. Signed-off-by: Michael Walle <mwalle@kernel.org> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-6-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
This commit is contained in:
committed by
Tudor Ambarus
parent
0554effe99
commit
d0cfd228b3
@@ -2018,11 +2018,6 @@ static const struct spi_nor_manufacturer *manufacturers[] = {
|
||||
static const struct flash_info spi_nor_generic_flash = {
|
||||
.name = "spi-nor-generic",
|
||||
.n_banks = 1,
|
||||
/*
|
||||
* JESD216 rev A doesn't specify the page size, therefore we need a
|
||||
* sane default.
|
||||
*/
|
||||
.page_size = 256,
|
||||
.parse_sfdp = true,
|
||||
};
|
||||
|
||||
@@ -3001,7 +2996,7 @@ static void spi_nor_init_default_params(struct spi_nor *nor)
|
||||
params->writesize = 1;
|
||||
params->size = info->size;
|
||||
params->bank_size = params->size;
|
||||
params->page_size = info->page_size;
|
||||
params->page_size = info->page_size ?: SPI_NOR_DEFAULT_PAGE_SIZE;
|
||||
|
||||
if (!(info->flags & SPI_NOR_NO_FR)) {
|
||||
/* Default to Fast Read for DT and non-DT platform devices. */
|
||||
|
||||
Reference in New Issue
Block a user