diff mbox

[v2] drm/fsl-dcu: Exchange fail_encoder and fail_connector

Message ID 1466067736-22754-1-git-send-email-meng.yi@nxp.com (mailing list archive)
State New, archived
Headers show

Commit Message

Meng Yi June 16, 2016, 9:02 a.m. UTC
Signed-off-by: Meng Yi <meng.yi@nxp.com>
---
Change in V2:
-add prefix "drm/fsl-dcu" to subject
---
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Meng Yi June 17, 2016, 4:02 a.m. UTC | #1
The lable fail_connector should placed before fail_encoder since encoder was
initialized before connector. which should also be called after connector initialization failed.

Hi Stefan,

What do you think?

> ---
> Change in V2:
> -add prefix "drm/fsl-dcu" to subject
> ---
>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 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..759527e 100644
> --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c
> +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c
> @@ -51,9 +51,9 @@ int fsl_dcu_drm_modeset_init(struct fsl_dcu_drm_device
> *fsl_dev)
>  	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);
> +fail_encoder:
> +	fsl_dev->crtc.funcs->destroy(&fsl_dev->crtc);
>  	return ret;
>  }
> --
> 2.1.0.27.g96db324

Best Regards,
Meng Yi
Stefan Agner June 19, 2016, 1:55 a.m. UTC | #2
On 2016-06-16 21:02, Meng Yi wrote:
> The lable fail_connector should placed before fail_encoder since encoder was
> initialized before connector. which should also be called after
> connector initialization failed.
> 
> Hi Stefan,
> 
> What do you think?

The current error handling is wrong, I agree. Just looked into it a bit
closer, I think the right thing to do would be to use
drm_mode_config_cleanup in any case, which will call all the destroy
functions. I will send out a patch which removes the current error
handling and uses drm_mode_config_cleanup.

--
Stefan


> 
>> ---
>> Change in V2:
>> -add prefix "drm/fsl-dcu" to subject
>> ---
>>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 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..759527e 100644
>> --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c
>> +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c
>> @@ -51,9 +51,9 @@ int fsl_dcu_drm_modeset_init(struct fsl_dcu_drm_device
>> *fsl_dev)
>>  	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);
>> +fail_encoder:
>> +	fsl_dev->crtc.funcs->destroy(&fsl_dev->crtc);
>>  	return ret;
>>  }
>> --
>> 2.1.0.27.g96db324
> 
> Best Regards,
> Meng Yi
diff mbox

Patch

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..759527e 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c
@@ -51,9 +51,9 @@  int fsl_dcu_drm_modeset_init(struct fsl_dcu_drm_device *fsl_dev)
 	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);
+fail_encoder:
+	fsl_dev->crtc.funcs->destroy(&fsl_dev->crtc);
 	return ret;
 }