Merge branch '2020-04-25-master-imports'
[oweals/u-boot.git] / fs / fs.c
diff --git a/fs/fs.c b/fs/fs.c
index 64ba25fea8bf3622dda1bdf6b71a1179177c1be9..0c66d6047703c76402c3e838b9a2e625492b99d2 100644 (file)
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -307,6 +307,19 @@ static struct fstype_info *fs_get_info(int fstype)
        return info;
 }
 
+/**
+ * fs_get_type() - Get type of current filesystem
+ *
+ * Return: filesystem type
+ *
+ * Returns filesystem type representing the current filesystem, or
+ * FS_TYPE_ANY for any unrecognised filesystem.
+ */
+int fs_get_type(void)
+{
+       return fs_type;
+}
+
 /**
  * fs_get_type_name() - Get type of current filesystem
  *
@@ -413,7 +426,6 @@ int fs_ls(const char *dirname)
 
        ret = info->ls(dirname);
 
-       fs_type = FS_TYPE_ANY;
        fs_close();
 
        return ret;
@@ -597,7 +609,6 @@ int fs_unlink(const char *filename)
 
        ret = info->unlink(filename);
 
-       fs_type = FS_TYPE_ANY;
        fs_close();
 
        return ret;
@@ -611,7 +622,6 @@ int fs_mkdir(const char *dirname)
 
        ret = info->mkdir(dirname);
 
-       fs_type = FS_TYPE_ANY;
        fs_close();
 
        return ret;