fs/driver: using nx_unlink to call unlink ops to release some resource

if driver complete unlink ops, we need to call it to release some resource,
otherwise, it will only remove inode.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
dongjiuzhu1
2023-12-22 11:06:12 +08:00
committed by Xiang Xiao
parent 3b79363041
commit e0c18c05e8
2 changed files with 24 additions and 23 deletions
+10
View File
@@ -44,6 +44,16 @@ int unregister_driver(FAR const char *path)
{
int ret;
/* Call unlink to release driver resource and inode. */
ret = nx_unlink(path);
if (ret >= 0)
{
return ret;
}
/* If unlink failed, only remove inode. */
ret = inode_lock();
if (ret >= 0)
{