aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorMarvin Borner2021-01-16 14:19:43 +0100
committerMarvin Borner2021-01-16 14:19:43 +0100
commit1ca3f322c81544ba769a0cd44fbd4bf03a8f875d (patch)
treead192e8967f82ec225bf08f13ca67987b9bcb6c8 /kernel
parent41cba1de51b328979ff2d0261b4141bb4e128fe6 (diff)
Fixed vfs dev finder
Diffstat (limited to 'kernel')
-rw-r--r--kernel/features/fs.c2
-rw-r--r--kernel/inc/fs.h2
2 files changed, 4 insertions, 0 deletions
diff --git a/kernel/features/fs.c b/kernel/features/fs.c
index 45e744c..48e736a 100644
--- a/kernel/features/fs.c
+++ b/kernel/features/fs.c
@@ -70,6 +70,8 @@ struct device *vfs_find_dev(const char *path)
{
assert(path[0] == '/');
struct mount_info *m = vfs_find_mount_info(path);
+ if (m->dev->vfs->type == VFS_DEVFS) // TODO: ?
+ return device_get_by_name(path + strlen(m->path) + 1);
return m && m->dev ? m->dev : NULL;
}
diff --git a/kernel/inc/fs.h b/kernel/inc/fs.h
index e5c444c..64db881 100644
--- a/kernel/inc/fs.h
+++ b/kernel/inc/fs.h
@@ -59,6 +59,8 @@ u32 vfs_write(const char *path, void *buf, u32 offset, u32 count);
u32 vfs_stat(const char *path, struct stat *buf);
u32 vfs_ready(const char *path);
+struct device *device_get_by_name(const char *name);
+
/**
* EXT2
*/