mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
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 <[email protected]> Cc: Zhi Wang <[email protected]> Cc: Jike Song <[email protected]> Signed-off-by: Alex Williamson <[email protected]> Reviewed by: Kirti Wankhede <[email protected]>
This commit is contained in:
parent
42930553a7
commit
9372e6feaa
6 changed files with 23 additions and 15 deletions
|
|
@ -30,6 +30,12 @@ static struct class_compat *mdev_bus_compat_class;
|
|||
static LIST_HEAD(mdev_list);
|
||||
static DEFINE_MUTEX(mdev_list_lock);
|
||||
|
||||
struct device *mdev_parent_dev(struct mdev_device *mdev)
|
||||
{
|
||||
return mdev->parent->dev;
|
||||
}
|
||||
EXPORT_SYMBOL(mdev_parent_dev);
|
||||
|
||||
static int _find_mdev_device(struct device *dev, void *data)
|
||||
{
|
||||
struct mdev_device *mdev;
|
||||
|
|
|
|||
|
|
@ -16,6 +16,16 @@
|
|||
int mdev_bus_register(void);
|
||||
void mdev_bus_unregister(void);
|
||||
|
||||
struct mdev_parent {
|
||||
struct device *dev;
|
||||
const struct mdev_parent_ops *ops;
|
||||
struct kref ref;
|
||||
struct mutex lock;
|
||||
struct list_head next;
|
||||
struct kset *mdev_types_kset;
|
||||
struct list_head type_list;
|
||||
};
|
||||
|
||||
struct mdev_type {
|
||||
struct kobject kobj;
|
||||
struct kobject *devices_kobj;
|
||||
|
|
|
|||
Loading…
Reference in a new issue