From fb748bae7f9b6d4f5b2c53b8360af75ccb18ddb2 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Wed, 21 Aug 2019 12:52:55 +1000 Subject: [PATCH] fatfs: Remove esp_vfs_fat_unregister() Deprecated in ESP-IDF V2.0 --- components/fatfs/vfs/esp_vfs_fat.h | 14 -------------- components/fatfs/vfs/vfs_fat.c | 13 ------------- 2 files changed, 27 deletions(-) diff --git a/components/fatfs/vfs/esp_vfs_fat.h b/components/fatfs/vfs/esp_vfs_fat.h index d3f9caa68..906d8b79b 100644 --- a/components/fatfs/vfs/esp_vfs_fat.h +++ b/components/fatfs/vfs/esp_vfs_fat.h @@ -51,20 +51,6 @@ extern "C" { esp_err_t esp_vfs_fat_register(const char* base_path, const char* fat_drive, size_t max_files, FATFS** out_fs); -/** - * @brief Un-register FATFS from VFS - * - * @note FATFS structure returned by esp_vfs_fat_register is destroyed after - * this call. Make sure to call f_mount function to unmount it before - * calling esp_vfs_fat_unregister. - * This function is left for compatibility and will be changed in - * future versions to accept base_path and replace the method below - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE if FATFS is not registered in VFS - */ -esp_err_t esp_vfs_fat_unregister(void) __attribute__((deprecated)); - /** * @brief Un-register FATFS from VFS * diff --git a/components/fatfs/vfs/vfs_fat.c b/components/fatfs/vfs/vfs_fat.c index e4be41516..bb0a666e4 100644 --- a/components/fatfs/vfs/vfs_fat.c +++ b/components/fatfs/vfs/vfs_fat.c @@ -205,19 +205,6 @@ esp_err_t esp_vfs_fat_unregister_path(const char* base_path) return ESP_OK; } -esp_err_t esp_vfs_fat_unregister(void) -{ - if (s_fat_ctx == NULL) { - return ESP_ERR_INVALID_STATE; - } - esp_err_t err = esp_vfs_fat_unregister_path(s_fat_ctx->base_path); - if (err != ESP_OK) { - return err; - } - s_fat_ctx = NULL; - return ESP_OK; -} - static int get_next_fd(vfs_fat_ctx_t* fat_ctx) { for (size_t i = 0; i < fat_ctx->max_files; ++i) {