public inbox for driver-core@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH 1/2] drm: vgem: do not use devres groups
@ 2026-01-28 23:20 Danilo Krummrich
  2026-01-28 23:20 ` [PATCH 2/2] drm: vkms: " Danilo Krummrich
  0 siblings, 1 reply; 2+ messages in thread
From: Danilo Krummrich @ 2026-01-28 23:20 UTC (permalink / raw)
  To: maarten.lankhorst, mripard, tzimmermann, airlied, simona,
	louis.chauvet, hamohammed.sa, melissa.srw, lyude, gregkh, rafael
  Cc: driver-core, linux-kernel, dri-devel, Danilo Krummrich

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-01-28 23:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-28 23:20 [PATCH 1/2] drm: vgem: do not use devres groups Danilo Krummrich
2026-01-28 23:20 ` [PATCH 2/2] drm: vkms: " Danilo Krummrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox