summaryrefslogtreecommitdiff
path: root/drivers/vfio/mdev/mdev_private.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/vfio/mdev/mdev_private.h')
-rw-r--r--drivers/vfio/mdev/mdev_private.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/vfio/mdev/mdev_private.h b/drivers/vfio/mdev/mdev_private.h
index f12e34e16ab9..fddab240ccc3 100644
--- a/drivers/vfio/mdev/mdev_private.h
+++ b/drivers/vfio/mdev/mdev_private.h
@@ -46,4 +46,16 @@ void mdev_remove_sysfs_files(struct mdev_device *mdev);
int mdev_device_create(struct mdev_type *kobj, const guid_t *uuid);
int mdev_device_remove(struct mdev_device *dev);
+void mdev_release_parent(struct kref *kref);
+
+static inline void mdev_get_parent(struct mdev_parent *parent)
+{
+ kref_get(&parent->ref);
+}
+
+static inline void mdev_put_parent(struct mdev_parent *parent)
+{
+ kref_put(&parent->ref, mdev_release_parent);
+}
+
#endif /* MDEV_PRIVATE_H */