From 2a8e7b064d9e919be8357e8e75439b57b9c6ab03 Mon Sep 17 00:00:00 2001 From: Gustavo Henrique Nihei Date: Tue, 19 Oct 2021 11:27:18 -0300 Subject: [PATCH] boards/esp32: Return proper error code on esp32_spiflash_init Signed-off-by: Gustavo Henrique Nihei --- boards/xtensa/esp32/common/src/esp32_board_spiflash.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/boards/xtensa/esp32/common/src/esp32_board_spiflash.c b/boards/xtensa/esp32/common/src/esp32_board_spiflash.c index 88d0d496339..43cb8ea17ab 100644 --- a/boards/xtensa/esp32/common/src/esp32_board_spiflash.c +++ b/boards/xtensa/esp32/common/src/esp32_board_spiflash.c @@ -226,7 +226,7 @@ static int setup_littlefs(const char *path, FAR struct mtd_dev_s *mtd, if (ret < 0) { ferr("ERROR: Failed to register MTD: %d\n", ret); - return ERROR; + return -ENOMEM; } if (mnt_pt != NULL) @@ -274,7 +274,7 @@ static int setup_spiffs(const char *path, FAR struct mtd_dev_s *mtd, if (ret < 0) { ferr("ERROR: Failed to register MTD: %d\n", ret); - return ERROR; + return -ENOMEM; } if (mnt_pt != NULL) @@ -354,7 +354,7 @@ static int init_wifi_partition(void) if (!mtd) { ferr("ERROR: Failed to alloc MTD partition of SPI Flash\n"); - return ERROR; + return -ENOMEM; } #ifdef CONFIG_ESP32_SPIFLASH_SMARTFS @@ -418,7 +418,7 @@ static int init_storage_partition(void) if (!mtd) { ferr("ERROR: Failed to alloc MTD partition of SPI Flash\n"); - return ERROR; + return -ENOMEM; } #ifdef CONFIG_ESP32_SPIFLASH_SMARTFS