diff options
author | Christoph Hellwig <hch@lst.de> | 2022-04-11 16:13:30 +0200 |
---|---|---|
committer | Zhi Wang <zhi.a.wang@intel.com> | 2022-04-21 07:36:56 -0400 |
commit | a85749e12d66c2cd89d1bce05ef9abca8b5875e9 (patch) | |
tree | 3ca6f8d9dc7c755529dae80f997b25cfb115a0ad | |
parent | 7f0cf30187cdb1f04d905505ffde910cecf1b35e (diff) | |
download | lwn-a85749e12d66c2cd89d1bce05ef9abca8b5875e9.tar.gz lwn-a85749e12d66c2cd89d1bce05ef9abca8b5875e9.zip |
drm/i915/gvt: remove module refcounting in intel_gvt_{,un}register_hypervisor
THIS_MODULE always is reference when a symbol called by it is used, so
don't bother with the additional reference.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-2-hch@lst.de
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com>
-rw-r--r-- | drivers/gpu/drm/i915/gvt/gvt.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/gvt/gvt.c b/drivers/gpu/drm/i915/gvt/gvt.c index f0b69e4dcb52..623424766c35 100644 --- a/drivers/gpu/drm/i915/gvt/gvt.c +++ b/drivers/gpu/drm/i915/gvt/gvt.c @@ -308,10 +308,6 @@ intel_gvt_register_hypervisor(const struct intel_gvt_mpt *m) m->type != INTEL_GVT_HYPERVISOR_XEN) return -EINVAL; - /* Get a reference for device model module */ - if (!try_module_get(THIS_MODULE)) - return -ENODEV; - intel_gvt_host.mpt = m; intel_gvt_host.hypervisor_type = m->type; gvt = (void *)kdev_to_i915(intel_gvt_host.dev)->gvt; @@ -321,7 +317,6 @@ intel_gvt_register_hypervisor(const struct intel_gvt_mpt *m) if (ret < 0) { gvt_err("Failed to init %s hypervisor module\n", supported_hypervisors[intel_gvt_host.hypervisor_type]); - module_put(THIS_MODULE); return -ENODEV; } gvt_dbg_core("Running with hypervisor %s in host mode\n", @@ -335,6 +330,5 @@ intel_gvt_unregister_hypervisor(void) { void *gvt = (void *)kdev_to_i915(intel_gvt_host.dev)->gvt; intel_gvt_hypervisor_host_exit(intel_gvt_host.dev, gvt); - module_put(THIS_MODULE); } EXPORT_SYMBOL_GPL(intel_gvt_unregister_hypervisor); |