Skip to contentSkip to conversation

drm/vkms: Drop unnecessary call to drm_crtc_cleanup()

PATCH In review José Expósito 3 participants 4 messages Oct 31, 2024 – Nov 4, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/vkms: Drop unnecessary call to drm_crtc_cleanup()

CRTC creation uses drmm_crtc_init_with_planes(), which automatically handles cleanup. However, an unnecessary call to drm_crtc_cleanup() is still present in the vkms_output_init() error path.

Fixes 99cc528ebe92 ("drm/vkms: Use drmm_crtc_init_with_planes()")
---
 drivers/gpu/drm/vkms/vkms_output.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/vkms/vkms_output.c +1 -4
index 0a5a185aa0b0..25a99fde126c 100644
@@ -92,7 +92,7 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index)
 				 DRM_MODE_CONNECTOR_VIRTUAL);
 	if (ret) {
 		DRM_ERROR("Failed to init connector\n");
-		goto err_connector;
+		return ret;
 	}
 
 	drm_connector_helper_add(connector, &vkms_conn_helper_funcs);
@@ -131,8 +131,5 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index)
 err_encoder:
 	drm_connector_cleanup(connector);
 
-err_connector:
-	drm_crtc_cleanup(crtc);
-
 	return ret;
 }
Signature · 1 line
2.47.0
maintainer
#1 lore raw
Quoted 3 lines · José Expósito

CRTC creation uses drmm_crtc_init_with_planes(), which automatically handles cleanup. However, an unnecessary call to drm_crtc_cleanup() is still present in the vkms_output_init() error path.

Thanks!

I discussed about this with Maíra on Monday, I agree with this patch!

I will test your patch next week (checkpatch, sparse, CI) before adding my Acked-by. One less cleanup line in configFS work, thanks!

Thanks,
Louis Chauvet

Quoted 31 lines
Fixes 99cc528ebe92 ("drm/vkms: Use drmm_crtc_init_with_planes()")
---
 drivers/gpu/drm/vkms/vkms_output.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/vkms/vkms_output.c +1 -4
index 0a5a185aa0b0..25a99fde126c 100644
@@ -92,7 +92,7 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index)
 				 DRM_MODE_CONNECTOR_VIRTUAL);
 	if (ret) {
 		DRM_ERROR("Failed to init connector\n");
-		goto err_connector;
+		return ret;
 	}
 
 	drm_connector_helper_add(connector, &vkms_conn_helper_funcs);
@@ -131,8 +131,5 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index)
 err_encoder:
 	drm_connector_cleanup(connector);
 
-err_connector:
-	drm_crtc_cleanup(crtc);
-
 	return ret;
 }
Signature · 1 line
2.47.0
Reviewed-by on v1 1/1
#2 lore raw
In reply to José Expósito

Hi José,

Quoted 6 lines · José Expósito

CRTC creation uses drmm_crtc_init_with_planes(), which automatically handles cleanup. However, an unnecessary call to drm_crtc_cleanup() is still present in the vkms_output_init() error path.

Fixes 99cc528ebe92 ("drm/vkms: Use drmm_crtc_init_with_planes()")

Best Regards,
- Maíra

Quoted 26 lines
---
  drivers/gpu/drm/vkms/vkms_output.c | 5 +----
  1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/vkms/vkms_output.c +1 -4
index 0a5a185aa0b0..25a99fde126c 100644
@@ -92,7 +92,7 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index)
  				 DRM_MODE_CONNECTOR_VIRTUAL);
  	if (ret) {
  		DRM_ERROR("Failed to init connector\n");
-		goto err_connector;
+		return ret;
  	}
 
  	drm_connector_helper_add(connector, &vkms_conn_helper_funcs);
@@ -131,8 +131,5 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index)
  err_encoder:
  	drm_connector_cleanup(connector);
 
-err_connector:
-	drm_crtc_cleanup(crtc);
-
  	return ret;
  }
maintainer Acked-by on v1 1/1
#3 lore raw
In reply to José Expósito
Quoted 6 lines · José Expósito

CRTC creation uses drmm_crtc_init_with_planes(), which automatically handles cleanup. However, an unnecessary call to drm_crtc_cleanup() is still present in the vkms_output_init() error path.

Fixes 99cc528ebe92 ("drm/vkms: Use drmm_crtc_init_with_planes()")

Applied on drm-misc-next:
https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/1d43dddd7c38ea1aa93f78f7ee10087afb0a561f

Quoted 29 lines
---
 drivers/gpu/drm/vkms/vkms_output.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/vkms/vkms_output.c +1 -4
index 0a5a185aa0b0..25a99fde126c 100644
@@ -92,7 +92,7 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index)
 				 DRM_MODE_CONNECTOR_VIRTUAL);
 	if (ret) {
 		DRM_ERROR("Failed to init connector\n");
-		goto err_connector;
+		return ret;
 	}
 
 	drm_connector_helper_add(connector, &vkms_conn_helper_funcs);
@@ -131,8 +131,5 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index)
 err_encoder:
 	drm_connector_cleanup(connector);
 
-err_connector:
-	drm_crtc_cleanup(crtc);
-
 	return ret;
 }
Signature · 1 line
2.47.0