From ad100e497a31056c8df77ad6853283f781b3c1c5 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Fri, 26 Jul 2019 14:32:09 +0200 Subject: [PATCH] spi_flash: remove duplicate definition of spi_flash_unlock The other (static) definition is in flash_ops.c, all references are also in flash_ops.c. --- components/spi_flash/esp_flash_api.c | 6 ------ components/spi_flash/flash_ops.c | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/components/spi_flash/esp_flash_api.c b/components/spi_flash/esp_flash_api.c index 8f68be541..146ebd12f 100644 --- a/components/spi_flash/esp_flash_api.c +++ b/components/spi_flash/esp_flash_api.c @@ -646,10 +646,4 @@ esp_err_t spi_flash_read(size_t src, void *dstv, size_t size) return spi_flash_translate_rc(err); } -esp_err_t spi_flash_unlock() -{ - esp_err_t err = esp_flash_set_chip_write_protect(NULL, false); - return spi_flash_translate_rc(err); -} - #endif // CONFIG_SPI_FLASH_USE_LEGACY_IMPL diff --git a/components/spi_flash/flash_ops.c b/components/spi_flash/flash_ops.c index 1b06447b1..3b582bb9f 100644 --- a/components/spi_flash/flash_ops.c +++ b/components/spi_flash/flash_ops.c @@ -198,7 +198,7 @@ static esp_rom_spiflash_result_t IRAM_ATTR spi_flash_unlock() } return ESP_ROM_SPIFLASH_RESULT_OK; } -#endif +#endif // CONFIG_SPI_FLASH_USE_LEGACY_IMPL esp_err_t IRAM_ATTR spi_flash_erase_sector(size_t sec) { @@ -419,7 +419,7 @@ out: return spi_flash_translate_rc(rc); } -#endif +#endif // CONFIG_SPI_FLASH_USE_LEGACY_IMPL esp_err_t IRAM_ATTR spi_flash_write_encrypted(size_t dest_addr, const void *src, size_t size) {