diff options
author | Alex Williamson <alex.williamson@redhat.com> | 2016-12-30 10:13:41 -0500 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2016-12-30 10:13:41 -0500 |
commit | 9372e6feaafb65d88f667ffb5b7b425f8568344f (patch) | |
tree | 2fa165cb84cc92d297d283f4fe171b045dcbeb61 /drivers/vfio/mdev/mdev_core.c | |
parent | 42930553a7c11f06351bc08b889808d0f6020f08 (diff) |
vfio-mdev: Make mdev_parent private
Rather than hoping for good behavior by marking some elements
internal, enforce it by making the entire structure private and
creating an accessor function for the one useful external field.
Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
Cc: Zhi Wang <zhi.a.wang@intel.com>
Cc: Jike Song <jike.song@intel.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed by: Kirti Wankhede <kwankhede@nvidia.com>
Diffstat (limited to 'drivers/vfio/mdev/mdev_core.c')
-rw-r--r-- | drivers/vfio/mdev/mdev_core.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/vfio/mdev/mdev_core.c b/drivers/vfio/mdev/mdev_core.c index bf3b3b0b3d2b..30d05304241e 100644 --- a/drivers/vfio/mdev/mdev_core.c +++ b/drivers/vfio/mdev/mdev_core.c | |||
@@ -30,6 +30,12 @@ static struct class_compat *mdev_bus_compat_class; | |||
30 | static LIST_HEAD(mdev_list); | 30 | static LIST_HEAD(mdev_list); |
31 | static DEFINE_MUTEX(mdev_list_lock); | 31 | static DEFINE_MUTEX(mdev_list_lock); |
32 | 32 | ||
33 | struct device *mdev_parent_dev(struct mdev_device *mdev) | ||
34 | { | ||
35 | return mdev->parent->dev; | ||
36 | } | ||
37 | EXPORT_SYMBOL(mdev_parent_dev); | ||
38 | |||
33 | static int _find_mdev_device(struct device *dev, void *data) | 39 | static int _find_mdev_device(struct device *dev, void *data) |
34 | { | 40 | { |
35 | struct mdev_device *mdev; | 41 | struct mdev_device *mdev; |