drm: vgem: do not use devres groups
Danilo Krummrich
maintainerPATCH 1/2 drm: vgem: do not use devres groups
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 <[email protected]>
--- drivers/gpu/drm/vgem/vgem_drv.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-)
drivers/gpu/drm/vgem/vgem_drv.c +3 -11
@@ -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
Signature · 1 line
2.52.0
Danilo Krummrich
maintainerPATCH 2/2 drm: vkms: do not use devres groups
Using devres groups in vkms is unnecessary, as the corresponding cleanup happens automatically when the device is unbound through faux_device_destroy().
Signed-off-by Danilo Krummrich <[email protected]>
--- drivers/gpu/drm/vkms/vkms_drv.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-)
drivers/gpu/drm/vkms/vkms_drv.c +6 -14
@@ -169,16 +169,11 @@ int vkms_create(struct vkms_config *config)if (!fdev)return -ENODEV ; -if (!devres_open_group (&fdev->dev,NULL ,GFP_KERNEL )) { - ret = -ENOMEM ; - goto out_unregister; - } - vkms_device =devm_drm_dev_alloc (&fdev->dev, &vkms_driver, struct vkms_device, drm);if (IS_ERR (vkms_device)) { ret =PTR_ERR (vkms_device); - goto out_devres; + goto out; } vkms_device->faux_dev = fdev; vkms_device->config = config;
@@ -189,33 +184,31 @@ int vkms_create(struct vkms_config *config)if (ret) {DRM_ERROR ("Could not initialize DMA support\n" ); - goto out_devres; + goto out; } ret =drm_vblank_init (&vkms_device->drm,vkms_config_get_num_crtcs (config));if (ret) {DRM_ERROR ("Failed to vblank\n" ); - goto out_devres; + goto out; } ret =vkms_modeset_init (vkms_device);if (ret) - goto out_devres; + goto out;vkms_config_register_debugfs (vkms_device); ret =drm_dev_register (&vkms_device->drm,0 );if (ret) - goto out_devres; + goto out;drm_client_setup (&vkms_device->drm,NULL );return 0 ; -out_devres: -devres_release_group (&fdev->dev,NULL ); -out_unregister: +out:faux_device_destroy (fdev);return ret; }
@@ -262,7 +255,6 @@ void vkms_destroy(struct vkms_config *config)drm_colorop_pipeline_destroy (&config->dev->drm);drm_dev_unregister (&config->dev->drm);drm_atomic_helper_shutdown (&config->dev->drm); -devres_release_group (&fdev->dev,NULL );faux_device_destroy (fdev); config->dev =NULL ;
Signature · 1 line
2.52.0