dev: add function to ref/deref device objects
This commit is contained in:
@@ -265,6 +265,14 @@ static inline struct object *framebuffer_device_object(struct framebuffer_device
|
||||
}
|
||||
|
||||
extern kern_status_t device_register(struct device *dev, struct driver *owner, struct device *parent);
|
||||
static inline struct device *device_ref(struct device *dev)
|
||||
{
|
||||
return cast_to_device(object_ref(&dev->dev_base));
|
||||
}
|
||||
static inline void device_deref(struct device *dev)
|
||||
{
|
||||
object_deref(&dev->dev_base);
|
||||
}
|
||||
|
||||
extern kern_status_t input_device_report_event(struct input_device *dev, const struct input_event *ev, bool noblock);
|
||||
extern kern_status_t input_device_read(struct device *dev, void *buf, size_t size, size_t *bytes_read, socks_flags_t flags);
|
||||
|
||||
Reference in New Issue
Block a user