boards/xtensa/esp32: Fix the SPI Flash MTD block device number

This commit fixes the SPI flash MTD block device number if OTA's
partitions are present. In this case, the OTA partitions are
registered first and the corresponding MTD block device drivers
are assigned with the numbers corresponding to those partitions.
Then, the additional SPI flash partition should consider that when
registering its own corresponding MTD block device driver.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
This commit is contained in:
Tiago Medicci Serrano
2025-04-15 18:37:27 -03:00
committed by Xiang Xiao
parent d976c66edf
commit a0cc89349f
@@ -429,7 +429,11 @@ static int init_storage_partition(void)
return ret;
}
#ifdef CONFIG_ESP32_HAVE_OTA_PARTITION
ret = ftl_initialize(nitems(g_ota_partition_table), mtd);
#else
ret = ftl_initialize(0, mtd);
#endif
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: Failed to initialize the FTL layer: %d\n",