mtd: spi-nor: Always build SPI_STACKED_PARALLEL code

Prevent the code gated by SPI_STACKED_PARALLEL from bitrot
by using if (CONFIG_IS_ENABLED(SPI_STACKED_PARALLEL)) around
it. That way, it is always at least compiled.

Fixes: 5d40b3d384 ("mtd: spi-nor: Add parallel and stacked memories support")
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
This commit is contained in:
Marek Vasut 2024-10-26 22:16:26 +02:00 committed by Tom Rini
parent f896aa6567
commit 43423cdc5d

View File

@ -3047,13 +3047,6 @@ static int spi_nor_init_params(struct spi_nor *nor,
const struct flash_info *info,
struct spi_nor_flash_parameter *params)
{
#if CONFIG_IS_ENABLED(DM_SPI) && CONFIG_IS_ENABLED(SPI_STACKED_PARALLEL)
struct udevice *dev = nor->spi->dev;
u64 flash_size[SNOR_FLASH_CNT_MAX] = {0};
u32 idx = 0, i = 0;
int rc;
#endif
/* Set legacy flash parameters as default. */
memset(params, 0, sizeof(*params));
@ -3172,7 +3165,13 @@ static int spi_nor_init_params(struct spi_nor *nor,
spi_nor_post_sfdp_fixups(nor, params);
}
#if CONFIG_IS_ENABLED(DM_SPI) && CONFIG_IS_ENABLED(SPI_STACKED_PARALLEL)
if (CONFIG_IS_ENABLED(SPI_STACKED_PARALLEL)) {
u64 flash_size[SNOR_FLASH_CNT_MAX] = { 0 };
struct udevice *dev = nor->spi->dev;
u32 idx = 0, i = 0;
int rc;
/*
* The flashes that are connected in stacked mode should be of same make.
* Except the flash size all other properties are identical for all the
@ -3227,7 +3226,8 @@ static int spi_nor_init_params(struct spi_nor *nor,
nor->mtd.erasesize <<= 1;
params->page_size <<= 1;
}
#endif
}
spi_nor_late_init_fixups(nor, params);
return 0;