summaryrefslogtreecommitdiff
path: root/shared-module
diff options
context:
space:
mode:
Diffstat (limited to 'shared-module')
-rw-r--r--shared-module/storage/__init__.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/shared-module/storage/__init__.c b/shared-module/storage/__init__.c
index 582b91a5b..97a049bac 100644
--- a/shared-module/storage/__init__.c
+++ b/shared-module/storage/__init__.c
@@ -78,16 +78,10 @@ void common_hal_storage_mount(mp_obj_t vfs_obj, const char* mount_path, bool rea
}
}
- // insert the vfs into the mount table
+ // Insert the vfs into the mount table by pushing it onto the front of the
+ // mount table.
mp_vfs_mount_t **vfsp = &MP_STATE_VM(vfs_mount_table);
- while (*vfsp != NULL) {
- if ((*vfsp)->len == 1) {
- // make sure anything mounted at the root stays at the end of the list
- vfs->next = *vfsp;
- break;
- }
- vfsp = &(*vfsp)->next;
- }
+ vfs->next = *vfsp;
*vfsp = vfs;
}