diff --git a/include/socks/device.h b/include/socks/device.h index 2377f4c..f13ff13 100644 --- a/include/socks/device.h +++ b/include/socks/device.h @@ -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);