From: Christoph Hellwig <hch@lst.de>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: David Airlie <airlied@linux.ie>,
Alex Williamson <alex.williamson@redhat.com>,
Cornelia Huck <cohuck@redhat.com>,
Jonathan Corbet <corbet@lwn.net>, Daniel Vetter <daniel@ffwll.ch>,
dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
intel-gvt-dev@lists.freedesktop.org,
Jani Nikula <jani.nikula@linux.intel.com>,
Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
kvm@vger.kernel.org, Kirti Wankhede <kwankhede@nvidia.com>,
linux-doc@vger.kernel.org, Rodrigo Vivi <rodrigo.vivi@intel.com>,
Zhenyu Wang <zhenyuw@linux.intel.com>,
Zhi Wang <zhi.a.wang@intel.com>,
"Raj, Ashok" <ashok.raj@intel.com>,
Dan Williams <dan.j.williams@intel.com>,
Christoph Hellwig <hch@lst.de>,
Leon Romanovsky <leonro@nvidia.com>,
Max Gurtovoy <mgurtovoy@nvidia.com>,
Tarun Gupta <targupta@nvidia.com>
Subject: Re: [PATCH 08/12] vfio/gvt: Convert to use vfio_register_group_dev()
Date: Mon, 26 Apr 2021 16:13:55 +0200 [thread overview]
Message-ID: <20210426141355.GF15209@lst.de> (raw)
In-Reply-To: <8-v1-d88406ed308e+418-vfio3_jgg@nvidia.com>
> diff --git a/drivers/vfio/mdev/Makefile b/drivers/vfio/mdev/Makefile
> index ff9ecd80212503..7c236ba1b90eb1 100644
> --- a/drivers/vfio/mdev/Makefile
> +++ b/drivers/vfio/mdev/Makefile
> @@ -1,5 +1,5 @@
> # SPDX-License-Identifier: GPL-2.0-only
>
> -mdev-y := mdev_core.o mdev_sysfs.o mdev_driver.o vfio_mdev.o
> +mdev-y := mdev_core.o mdev_sysfs.o mdev_driver.o
>
> obj-$(CONFIG_VFIO_MDEV) += mdev.o
> diff --git a/drivers/vfio/mdev/mdev_core.c b/drivers/vfio/mdev/mdev_core.c
> index 51b8a9fcf866ad..f95d01b57fb168 100644
> --- a/drivers/vfio/mdev/mdev_core.c
> +++ b/drivers/vfio/mdev/mdev_core.c
I think all these mdev core changes belong into a separate commit with a
separate commit log.
> static int __init mdev_init(void)
> {
> - int rc;
> -
> - rc = mdev_bus_register();
> - if (rc)
> - return rc;
> - rc = mdev_register_driver(&vfio_mdev_driver);
> - if (rc)
> - goto err_bus;
> - return 0;
> -err_bus:
> - mdev_bus_unregister();
> - return rc;
> + return mdev_bus_register();
Weird indentation. But I think it would be best to just kill off the
mdev_init wrapper anyway.
> static void __exit mdev_exit(void)
> {
> - mdev_unregister_driver(&vfio_mdev_driver);
> -
> if (mdev_bus_compat_class)
> class_compat_unregister(mdev_bus_compat_class);
> -
> mdev_bus_unregister();
> }
Same here.
> diff --git a/drivers/vfio/mdev/mdev_driver.c b/drivers/vfio/mdev/mdev_driver.c
> index 6e96c023d7823d..0012a9ee7cb0a4 100644
> --- a/drivers/vfio/mdev/mdev_driver.c
> +++ b/drivers/vfio/mdev/mdev_driver.c
> @@ -74,15 +74,8 @@ static int mdev_remove(struct device *dev)
> static int mdev_match(struct device *dev, struct device_driver *drv)
> {
> struct mdev_device *mdev = to_mdev_device(dev);
> +
> + return drv == &mdev->type->parent->ops->device_driver->driver;
> }
Btw, I think we don't even need ->match with the switch to use
device_bind_driver that I suggested.
> -EXPORT_SYMBOL_GPL(vfio_init_group_dev);
> +EXPORT_SYMBOL(vfio_init_group_dev);
> -EXPORT_SYMBOL_GPL(vfio_register_group_dev);
> +EXPORT_SYMBOL(vfio_register_group_dev);
> -EXPORT_SYMBOL_GPL(vfio_unregister_group_dev);
> +EXPORT_SYMBOL(vfio_unregister_group_dev);
Err, no. vfio should remain EXPORT_SYMBOL_GPL, just because the weird
mdev "GPL condom" that should never have been merged in that form went away.
next prev parent reply other threads:[~2021-04-26 14:14 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-23 23:02 [PATCH 00/12] Remove vfio_mdev.c, mdev_parent_ops and more Jason Gunthorpe
2021-04-23 23:02 ` [PATCH 01/12] vfio/mdev: Remove CONFIG_VFIO_MDEV_DEVICE Jason Gunthorpe
2021-04-24 0:08 ` Randy Dunlap
2021-04-26 18:26 ` Jason Gunthorpe
2021-04-26 19:11 ` Randy Dunlap
2021-04-23 23:02 ` [PATCH 02/12] vfio/mdev: Allow the mdev_parent_ops to specify the device driver to bind Jason Gunthorpe
2021-04-26 14:02 ` Christoph Hellwig
2021-04-26 14:11 ` Jason Gunthorpe
2021-04-23 23:03 ` [PATCH 03/12] vfio/mtty: Convert to use vfio_register_group_dev() Jason Gunthorpe
2021-04-26 14:06 ` Christoph Hellwig
2021-04-23 23:03 ` [PATCH 04/12] vfio/mdpy: " Jason Gunthorpe
2021-04-26 14:06 ` Christoph Hellwig
2021-04-23 23:03 ` [PATCH 05/12] vfio/mbochs: " Jason Gunthorpe
2021-04-26 14:06 ` Christoph Hellwig
2021-04-23 23:03 ` [PATCH 07/12] vfio/ccw: " Jason Gunthorpe
2021-04-23 23:03 ` [PATCH 08/12] vfio/gvt: " Jason Gunthorpe
2021-04-26 14:13 ` Christoph Hellwig [this message]
2021-04-26 15:44 ` Jason Gunthorpe
2021-04-23 23:03 ` [PATCH 09/12] vfio/mdev: Remove mdev_parent_ops dev_attr_groups Jason Gunthorpe
2021-04-26 14:14 ` Christoph Hellwig
2021-04-23 23:03 ` [PATCH 10/12] vfio/mdev: Remove mdev_parent_ops Jason Gunthorpe
2021-04-26 14:19 ` Christoph Hellwig
2021-04-26 18:33 ` Jason Gunthorpe
2021-04-23 23:03 ` [PATCH 11/12] vfio/mdev: Use the driver core to create the 'remove' file Jason Gunthorpe
2021-04-26 14:20 ` Christoph Hellwig
2021-04-26 19:07 ` Jason Gunthorpe
2021-04-23 23:03 ` [PATCH 12/12] vfio/mdev: Remove mdev drvdata Jason Gunthorpe
2021-04-26 14:20 ` Christoph Hellwig
2021-04-26 16:43 ` [PATCH 00/12] Remove vfio_mdev.c, mdev_parent_ops and more Christian Borntraeger
2021-04-26 17:42 ` Jason Gunthorpe
2021-04-27 7:33 ` Christian Borntraeger
2021-04-27 23:21 ` Jason Gunthorpe
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=20210426141355.GF15209@lst.de \
--to=hch@lst.de \
--cc=airlied@linux.ie \
--cc=alex.williamson@redhat.com \
--cc=ashok.raj@intel.com \
--cc=cohuck@redhat.com \
--cc=corbet@lwn.net \
--cc=dan.j.williams@intel.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-gvt-dev@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=jgg@nvidia.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=kvm@vger.kernel.org \
--cc=kwankhede@nvidia.com \
--cc=leonro@nvidia.com \
--cc=linux-doc@vger.kernel.org \
--cc=mgurtovoy@nvidia.com \
--cc=rodrigo.vivi@intel.com \
--cc=targupta@nvidia.com \
--cc=zhenyuw@linux.intel.com \
--cc=zhi.a.wang@intel.com \
/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;
as well as URLs for NNTP newsgroup(s).