dev: add functions to create device objects

This commit is contained in:
2023-04-03 16:59:14 +01:00
parent 7c6f619b96
commit 5b53168c5f
8 changed files with 105 additions and 1 deletions

12
dev/char.c Normal file
View File

@@ -0,0 +1,12 @@
#include <socks/device.h>
struct char_device *char_device_create(void)
{
struct device *dev = device_alloc();
if (!dev) {
return NULL;
}
dev->dev_type = DEV_TYPE_CHAR;
return CHAR_DEVICE(dev);
}