Re: [PATCH] vfio: replace vfio->class with a const struct class

From: Alex Williamson

Date: Fri Mar 20 2026 - 17:22:24 EST


On Fri, 6 Mar 2026 20:06:28 +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 vfio->class with a const struct class and drop the
> class_create() call.
>
> Compile tested and found no errors/warns in dmesg after enabling
> VFIO_GROUP.
>
> 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>
> ---
> drivers/vfio/group.c | 23 +++++++++++------------
> 1 file changed, 11 insertions(+), 12 deletions(-)

Applied to vfio next branch for v7.1. Thanks,

Alex