kernel-hacking-2024-linux-s.../samples/vfio-mdev
Christoph Hellwig da44c340c4 vfio/mdev: simplify mdev_type handling
Instead of abusing struct attribute_group to control initialization of
struct mdev_type, just define the actual attributes in the mdev_driver,
allocate the mdev_type structures in the caller and pass them to
mdev_register_parent.

This allows the caller to use container_of to get at the containing
structure and thus significantly simplify the code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Tony Krowiak <akrowiak@linux.ibm.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Kirti Wankhede <kwankhede@nvidia.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Link: https://lore.kernel.org/r/20220923092652.100656-6-hch@lst.de
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2022-10-04 12:06:58 -06:00
..
Makefile
mbochs.c vfio/mdev: simplify mdev_type handling 2022-10-04 12:06:58 -06:00
mdpy-defs.h PCI: Move PCI_VENDOR_ID_REDHAT definition to pci_ids.h 2020-07-09 17:00:47 -05:00
mdpy-fb.c samples: vfio-mdev: fix error handing in mdpy_fb_probe() 2021-05-24 13:40:13 -06:00
mdpy.c vfio/mdev: simplify mdev_type handling 2022-10-04 12:06:58 -06:00
mtty.c vfio/mdev: simplify mdev_type handling 2022-10-04 12:06:58 -06:00