linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/fsl-dcu: use drm_mode_config_cleanup on initialization errors
@ 2016-06-19  2:15 Stefan Agner
  2016-06-21 13:54 ` Thierry Reding
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Agner @ 2016-06-19  2:15 UTC (permalink / raw)
  To: dri-devel
  Cc: meng.yi, alison.wang, jianwei.wang.chn, linux-kernel, Stefan Agner

Commit 7566e247672d ("drm/fsl-dcu: handle initialization errors properly")
introduced error handling during initialization, but with a wrong cleanup
order.

Replace the error handling with the generic cleanup function
drm_mode_config_cleanup.

Signed-off-by: Stefan Agner <stefan@agner.ch>
---
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c
index c564ec6..a6e4cd5 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c
@@ -37,23 +37,22 @@ int fsl_dcu_drm_modeset_init(struct fsl_dcu_drm_device *fsl_dev)
 
 	ret = fsl_dcu_drm_crtc_create(fsl_dev);
 	if (ret)
-		return ret;
+		goto err;
 
 	ret = fsl_dcu_drm_encoder_create(fsl_dev, &fsl_dev->crtc);
 	if (ret)
-		goto fail_encoder;
+		goto err;
 
 	ret = fsl_dcu_drm_connector_create(fsl_dev, &fsl_dev->encoder);
 	if (ret)
-		goto fail_connector;
+		goto err;
 
 	drm_mode_config_reset(fsl_dev->drm);
 	drm_kms_helper_poll_init(fsl_dev->drm);
 
 	return 0;
-fail_encoder:
-	fsl_dev->crtc.funcs->destroy(&fsl_dev->crtc);
-fail_connector:
-	fsl_dev->encoder.funcs->destroy(&fsl_dev->encoder);
+
+err:
+	drm_mode_config_cleanup(fsl_dev->drm);
 	return ret;
 }
-- 
2.8.3

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

* Re: [PATCH] drm/fsl-dcu: use drm_mode_config_cleanup on initialization errors
  2016-06-19  2:15 [PATCH] drm/fsl-dcu: use drm_mode_config_cleanup on initialization errors Stefan Agner
@ 2016-06-21 13:54 ` Thierry Reding
  0 siblings, 0 replies; 2+ messages in thread
From: Thierry Reding @ 2016-06-21 13:54 UTC (permalink / raw)
  To: Stefan Agner
  Cc: dri-devel, jianwei.wang.chn, meng.yi, linux-kernel, alison.wang

[-- Attachment #1: Type: text/plain, Size: 550 bytes --]

On Sat, Jun 18, 2016 at 07:15:43PM -0700, Stefan Agner wrote:
> Commit 7566e247672d ("drm/fsl-dcu: handle initialization errors properly")
> introduced error handling during initialization, but with a wrong cleanup
> order.
> 
> Replace the error handling with the generic cleanup function
> drm_mode_config_cleanup.
> 
> Signed-off-by: Stefan Agner <stefan@agner.ch>
> ---
>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)

Applied to topic/drm-misc, thanks.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2016-06-21 13:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-19  2:15 [PATCH] drm/fsl-dcu: use drm_mode_config_cleanup on initialization errors Stefan Agner
2016-06-21 13:54 ` Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).