From 643876fb77d45540e5b82f450a7907f39ec95c6a Mon Sep 17 00:00:00 2001
From: Damien George <damien.p.george@gmail.com>
Date: Mon, 13 Mar 2017 21:23:31 +1100
Subject: [PATCH] extmod/vfs_fat: Allow to compile with MICROPY_VFS_FAT
 disabled.

Some ports may want to compile with generic MICROPY_VFS support but without
the VfsFat class.  This patch allows such a thing.
---
 extmod/vfs_fat_diskio.c | 4 ++--
 extmod/vfs_fat_file.c   | 6 ++----
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/extmod/vfs_fat_diskio.c b/extmod/vfs_fat_diskio.c
index 7efcc22f2..24c00ffba 100644
--- a/extmod/vfs_fat_diskio.c
+++ b/extmod/vfs_fat_diskio.c
@@ -28,7 +28,7 @@
  */
 
 #include "py/mpconfig.h"
-#if MICROPY_VFS
+#if MICROPY_VFS && MICROPY_VFS_FAT
 
 #include <stdint.h>
 #include <stdio.h>
@@ -277,4 +277,4 @@ DRESULT disk_ioctl (
     }
 }
 
-#endif // MICROPY_VFS
+#endif // MICROPY_VFS && MICROPY_VFS_FAT
diff --git a/extmod/vfs_fat_file.c b/extmod/vfs_fat_file.c
index 6263492cb..edffa37c7 100644
--- a/extmod/vfs_fat_file.c
+++ b/extmod/vfs_fat_file.c
@@ -25,7 +25,7 @@
  */
 
 #include "py/mpconfig.h"
-#if MICROPY_VFS
+#if MICROPY_VFS && MICROPY_VFS_FAT
 
 #include <stdio.h>
 #include <errno.h>
@@ -37,10 +37,8 @@
 #include "lib/oofatfs/ff.h"
 #include "extmod/vfs_fat.h"
 
-#if MICROPY_VFS_FAT
 #define mp_type_fileio fatfs_type_fileio
 #define mp_type_textio fatfs_type_textio
-#endif
 
 extern const mp_obj_type_t mp_type_fileio;
 extern const mp_obj_type_t mp_type_textio;
@@ -300,4 +298,4 @@ mp_obj_t fatfs_builtin_open_self(mp_obj_t self_in, mp_obj_t path, mp_obj_t mode)
     return file_open(self, &mp_type_textio, arg_vals);
 }
 
-#endif // MICROPY_VFS
+#endif // MICROPY_VFS && MICROPY_VFS_FAT
-- 
GitLab