File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,19 +109,15 @@ void common_hal_storage_umount_object(mp_obj_t vfs_obj) {
109109 mp_vfs_proxy_call (vfs , MP_QSTR_umount , 0 , NULL );
110110}
111111
112- void common_hal_storage_umount_path (const char * mount_path ) {
113- // remove vfs from the mount table
114- mp_obj_t * vfs_obj = NULL ;
112+ STATIC mp_obj_t storage_object_from_path (const char * mount_path ) {
115113 for (mp_vfs_mount_t * * vfsp = & MP_STATE_VM (vfs_mount_table ); * vfsp != NULL ; vfsp = & (* vfsp )-> next ) {
116114 if (strcmp (mount_path , (* vfsp )-> str ) == 0 ) {
117- vfs_obj = (* vfsp )-> obj ;
118- break ;
115+ return (* vfsp )-> obj ;
119116 }
120117 }
118+ mp_raise_OSError (MP_EINVAL );
119+ }
121120
122- if (vfs_obj == NULL ) {
123- mp_raise_OSError (MP_EINVAL );
124- }
125-
126- common_hal_storage_umount_object (vfs_obj );
121+ void common_hal_storage_umount_path (const char * mount_path ) {
122+ common_hal_storage_umount_object (storage_object_from_path (mount_path ));
127123}
You can’t perform that action at this time.
0 commit comments