aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/ic/nvme.c2
-rw-r--r--sys/fs/devfs.c8
-rw-r--r--sys/include/fs/devfs.h2
3 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/ic/nvme.c b/sys/dev/ic/nvme.c
index 4dd5f8e..addfd66 100644
--- a/sys/dev/ic/nvme.c
+++ b/sys/dev/ic/nvme.c
@@ -413,7 +413,7 @@ nvme_init_ns(struct nvme_state *state, uint16_t nsid)
ns->dev_id = device_create(dev, state->major, nsid);
snprintf(devname, sizeof(devname), "nvme0n%d", nsid);
- if (devfs_add_blkdev(devname, dev) != 0) {
+ if (devfs_add_dev(devname, dev) != 0) {
KERR("Failed to create /dev/%s\n", devname);
}
diff --git a/sys/fs/devfs.c b/sys/fs/devfs.c
index 42150e6..7e7fd9d 100644
--- a/sys/fs/devfs.c
+++ b/sys/fs/devfs.c
@@ -183,7 +183,7 @@ devfs_make_devicenode(const char *name, struct device_node **node_out)
}
int
-devfs_add_blkdev(const char *name, const struct device *blkdev)
+devfs_add_dev(const char *name, const struct device *dev)
{
struct device_node *node;
int status;
@@ -192,9 +192,9 @@ devfs_add_blkdev(const char *name, const struct device *blkdev)
return status;
}
- node->major = blkdev->major;
- node->minor = blkdev->minor;
- node->is_block = 1;
+ node->major = dev->major;
+ node->minor = dev->minor;
+ node->is_block = dev->blocksize > 1;
TAILQ_INSERT_HEAD(&nodes, node, link);
return 0;
}
diff --git a/sys/include/fs/devfs.h b/sys/include/fs/devfs.h
index 1fa4ada..7f32f8c 100644
--- a/sys/include/fs/devfs.h
+++ b/sys/include/fs/devfs.h
@@ -36,6 +36,6 @@
extern struct vfsops g_devfs_ops;
extern struct vops g_devfs_vops;
-int devfs_add_blkdev(const char *name, const struct device *blkdev);
+int devfs_add_dev(const char *name, const struct device *dev);
#endif