vfio: Make vfio_device_ops pass a 'struct vfio_device *' instead of 'void *'
authorJason Gunthorpe <jgg@nvidia.com>
Tue, 30 Mar 2021 15:53:08 +0000 (09:53 -0600)
committerAlex Williamson <alex.williamson@redhat.com>
Tue, 6 Apr 2021 17:55:11 +0000 (11:55 -0600)
commit6df62c5b05f4ad6876815ea8b8775905a090224a
tree5573ffa1f6aa10a74d807b9bb161fc188885af41
parent66873b5fa738ca02b5c075ca4a410b13d88e6e9a
vfio: Make vfio_device_ops pass a 'struct vfio_device *' instead of 'void *'

This is the standard kernel pattern, the ops associated with a struct get
the struct pointer in for typesafety. The expected design is to use
container_of to cleanly go from the subsystem level type to the driver
level type without having any type erasure in a void *.

Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Message-Id: <12-v3-225de1400dfc+4e074-vfio1_jgg@nvidia.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Documentation/driver-api/vfio.rst
drivers/vfio/fsl-mc/vfio_fsl_mc.c
drivers/vfio/mdev/vfio_mdev.c
drivers/vfio/pci/vfio_pci.c
drivers/vfio/platform/vfio_platform_common.c
drivers/vfio/vfio.c
include/linux/vfio.h