linux/drivers/vfio/mdev
Jason Gunthorpe 15fcc44be0 vfio/mdev: Add mdev/mtype_get_type_group_id()
This returns the index in the supported_type_groups array that is
associated with the mdev_type attached to the struct mdev_device or its
containing struct kobject.

Each mdev_device can be spawned from exactly one mdev_type, which in turn
originates from exactly one supported_type_group.

Drivers are using weird string calculations to try and get back to this
index, providing a direct access to the index removes a bunch of wonky
driver code.

mdev_type->group can be deleted as the group is obtained using the
type_group_id.

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: <11-v2-d36939638fc6+d54-vfio2_jgg@nvidia.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2021-04-07 15:39:18 -06:00
..
Kconfig docs: driver-api: add a series of orphaned documents 2019-07-15 11:03:02 -03:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
mdev_core.c vfio/mdev: Add mdev/mtype_get_type_group_id() 2021-04-07 15:39:18 -06:00
mdev_driver.c vfio/mdev: Simplify driver registration 2021-04-07 15:39:16 -06:00
mdev_private.h vfio/mdev: Add mdev/mtype_get_type_group_id() 2021-04-07 15:39:18 -06:00
mdev_sysfs.c vfio/mdev: Add mdev/mtype_get_type_group_id() 2021-04-07 15:39:18 -06:00
vfio_mdev.c vfio/mdev: Remove duplicate storage of parent in mdev_device 2021-04-07 15:39:18 -06:00