public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Jori Koolstra <jkoolstra@xs4all.nl>
Cc: Kirti Wankhede <kwankhede@nvidia.com>,
	"open list:VFIO MEDIATED DEVICE DRIVERS" <kvm@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] vfio: mdev: replace mtty_dev->vd_class with a const struct class
Date: Sun, 8 Mar 2026 17:20:17 +0100	[thread overview]
Message-ID: <2026030833-encrust-cubical-61c8@gregkh> (raw)
In-Reply-To: <20260308133733.1110551-1-jkoolstra@xs4all.nl>

On Sun, Mar 08, 2026 at 02:37:33PM +0100, Jori Koolstra 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@linuxfoundation.org>
> Signed-off-by: Jori Koolstra <jkoolstra@xs4all.nl>
> ---
>  samples/vfio-mdev/mtty.c | 27 ++++++++++++++-------------
>  1 file changed, 14 insertions(+), 13 deletions(-)
> 
> diff --git a/samples/vfio-mdev/mtty.c b/samples/vfio-mdev/mtty.c
> index bd92c38379b8..792f5c212fd1 100644
> --- a/samples/vfio-mdev/mtty.c
> +++ b/samples/vfio-mdev/mtty.c
> @@ -68,13 +68,16 @@
>   * Global Structures
>   */
>  
> +static const struct class mtty_class = {
> +	.name	= MTTY_CLASS_NAME
> +};
> +
>  static struct mtty_dev {
> -	dev_t		vd_devt;
> -	struct class	*vd_class;
> -	struct cdev	vd_cdev;
> -	struct idr	vd_idr;
> -	struct device	dev;
> -	struct mdev_parent parent;
> +	dev_t			vd_devt;
> +	struct cdev		vd_cdev;
> +	struct idr		vd_idr;
> +	struct device		dev;
> +	struct mdev_parent	parent;

No need to reformat this structure :(

thanks,

greg k-h

      reply	other threads:[~2026-03-08 16:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-08 13:37 [PATCH] vfio: mdev: replace mtty_dev->vd_class with a const struct class Jori Koolstra
2026-03-08 16:20 ` Greg KH [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2026030833-encrust-cubical-61c8@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=jkoolstra@xs4all.nl \
    --cc=kvm@vger.kernel.org \
    --cc=kwankhede@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox