vfio/mdev: Use struct mdev_type in struct mdev_device
authorJason Gunthorpe <jgg@nvidia.com>
Tue, 6 Apr 2021 19:40:28 +0000 (16:40 -0300)
committerAlex Williamson <alex.williamson@redhat.com>
Wed, 7 Apr 2021 21:39:17 +0000 (15:39 -0600)
commit417fd5bf242d7691c15fe0bd705ab76c69276572
tree3e1fb6626122c6beaf352d89a74770a37bdd19b9
parent91b9969d9c6bb7c02253bbfc536bfd892f636fdc
vfio/mdev: Use struct mdev_type in struct mdev_device

The kobj pointer in mdev_device is actually pointing at a struct
mdev_type. Use the proper type so things are understandable.

There are a number of places that are confused and passing both the mdev
and the mtype as function arguments, fix these to derive the mtype
directly from the mdev to remove the redundancy.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Message-Id: <5-v2-d36939638fc6+d54-vfio2_jgg@nvidia.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/mdev/mdev_core.c
drivers/vfio/mdev/mdev_private.h
drivers/vfio/mdev/mdev_sysfs.c
include/linux/mdev.h