Re: [PATCH v2] vfio: mdev: replace mtty_dev->vd_class with a const struct class
From: Alex Williamson
Date: Fri Mar 20 2026 - 17:20:56 EST
On Sun, 8 Mar 2026 22:49:39 +0100
Jori Koolstra <jkoolstra@xxxxxxxxx> wrote:
> The class_create() call has been deprecated in favor of class_register()
> as the driver core now allows for a struct class to be in read-only
> memory. Replace mtty_dev->vd_class with a const struct class and drop the
> class_create() call.
>
> Compile tested and found no errors/warns in dmesg after enabling
> CONFIG_VFIO and CONFIG_SAMPLE_VFIO_MDEV_MTTY.
>
> Link: https://lore.kernel.org/all/2023040244-duffel-pushpin-f738@gregkh/
>
> Suggested-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Jori Koolstra <jkoolstra@xxxxxxxxx>
> ---
> v2: undo whitespace reformating of struct mtty_dev
>
> samples/vfio-mdev/mtty.c | 17 +++++++++--------
> 1 file changed, 9 insertions(+), 8 deletions(-)
Applied to vfio next branch for v7.1. Thanks,
Alex