From: Danilo Krummrich <dakr@kernel.org>
To: maarten.lankhorst@linux.intel.com, mripard@kernel.org,
tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch,
louis.chauvet@bootlin.com, hamohammed.sa@gmail.com,
melissa.srw@gmail.com, lyude@redhat.com,
gregkh@linuxfoundation.org, rafael@kernel.org
Cc: driver-core@lists.linux.dev, linux-kernel@vger.kernel.org,
dri-devel@lists.freedesktop.org,
Danilo Krummrich <dakr@kernel.org>
Subject: [PATCH 1/2] drm: vgem: do not use devres groups
Date: Thu, 29 Jan 2026 00:20:33 +0100 [thread overview]
Message-ID: <20260128232038.2399-1-dakr@kernel.org> (raw)
Using devres groups in vgem is unnecessary, as the corresponding cleanup
happens automatically when the device is unbound through
faux_device_destroy().
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
---
drivers/gpu/drm/vgem/vgem_drv.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c
index 260c64733972..d75f2ee56cf6 100644
--- a/drivers/gpu/drm/vgem/vgem_drv.c
+++ b/drivers/gpu/drm/vgem/vgem_drv.c
@@ -133,11 +133,6 @@ static int __init vgem_init(void)
if (!fdev)
return -ENODEV;
- if (!devres_open_group(&fdev->dev, NULL, GFP_KERNEL)) {
- ret = -ENOMEM;
- goto out_unregister;
- }
-
dma_coerce_mask_and_coherent(&fdev->dev,
DMA_BIT_MASK(64));
@@ -145,20 +140,18 @@ static int __init vgem_init(void)
struct vgem_device, drm);
if (IS_ERR(vgem_device)) {
ret = PTR_ERR(vgem_device);
- goto out_devres;
+ goto out;
}
vgem_device->faux_dev = fdev;
/* Final step: expose the device/driver to userspace */
ret = drm_dev_register(&vgem_device->drm, 0);
if (ret)
- goto out_devres;
+ goto out;
return 0;
-out_devres:
- devres_release_group(&fdev->dev, NULL);
-out_unregister:
+out:
faux_device_destroy(fdev);
return ret;
}
@@ -168,7 +161,6 @@ static void __exit vgem_exit(void)
struct faux_device *fdev = vgem_device->faux_dev;
drm_dev_unregister(&vgem_device->drm);
- devres_release_group(&fdev->dev, NULL);
faux_device_destroy(fdev);
}
base-commit: a50007089e078a1b7a826559a02277b1601ee189
--
2.52.0
next reply other threads:[~2026-01-28 23:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-28 23:20 Danilo Krummrich [this message]
2026-01-28 23:20 ` [PATCH 2/2] drm: vkms: do not use devres groups Danilo Krummrich
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=20260128232038.2399-1-dakr@kernel.org \
--to=dakr@kernel.org \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=driver-core@lists.linux.dev \
--cc=gregkh@linuxfoundation.org \
--cc=hamohammed.sa@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=louis.chauvet@bootlin.com \
--cc=lyude@redhat.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=melissa.srw@gmail.com \
--cc=mripard@kernel.org \
--cc=rafael@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/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