Files
mango/dev/block.c
Max Wash c5edce612d dev: implement generic devices
generic devices don't have a type (char, block, etc) and are created
by bus drivers to represent the device until a suitable driver is found.

generic devices are registered by the bus driver. once a more suitable
driver is found, that driver will re-register the device under itself.
2023-06-10 13:21:42 +01:00

20 lines
341 B
C

#include <socks/device.h>
struct block_device *block_device_create(void)
{
struct device *dev = device_alloc();
if (!dev) {
return NULL;
}
dev->dev_type = DEV_TYPE_BLOCK;
return BLOCK_DEVICE(dev);
}
struct block_device *block_device_from_generic(struct device *dev)
{
dev->dev_type = DEV_TYPE_BLOCK;
return BLOCK_DEVICE(dev);
}