dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] drm/exynos: Fix de-registration ordering
@ 2014-06-17 11:38 Sachin Kamat
  2014-06-18  5:23 ` Inki Dae
  0 siblings, 1 reply; 3+ messages in thread
From: Sachin Kamat @ 2014-06-17 11:38 UTC (permalink / raw)
  To: dri-devel; +Cc: spk.linux, sw0312.kim

'exynos_drm_pdev' was not getting unregistered if platform_driver_register()
failed. Fix the ordering to allow this. This also fixes the below warning by
moving the #endif macro. While at it also fix the ordering in the exit function
so that de-registration happens in opposite order of registration.
drivers/gpu/drm/exynos/exynos_drm_drv.c:768:1: warning: label ‘err_unregister_pd’ defined but not used [-Wunused-label]

Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_drm_drv.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index 5d225dd5..f72ca0c 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -765,24 +765,24 @@ static int exynos_drm_init(void)
 
 	return 0;
 
-err_unregister_pd:
-	platform_device_unregister(exynos_drm_pdev);
-
 err_remove_vidi:
 #ifdef CONFIG_DRM_EXYNOS_VIDI
 	exynos_drm_remove_vidi();
+
+err_unregister_pd:
 #endif
+	platform_device_unregister(exynos_drm_pdev);
 
 	return ret;
 }
 
 static void exynos_drm_exit(void)
 {
+	platform_driver_unregister(&exynos_drm_platform_driver);
 #ifdef CONFIG_DRM_EXYNOS_VIDI
 	exynos_drm_remove_vidi();
 #endif
 	platform_device_unregister(exynos_drm_pdev);
-	platform_driver_unregister(&exynos_drm_platform_driver);
 }
 
 module_init(exynos_drm_init);
-- 
1.7.9.5

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH 1/1] drm/exynos: Fix de-registration ordering
  2014-06-17 11:38 [PATCH 1/1] drm/exynos: Fix de-registration ordering Sachin Kamat
@ 2014-06-18  5:23 ` Inki Dae
  2014-06-18  5:27   ` Sachin Kamat
  0 siblings, 1 reply; 3+ messages in thread
From: Inki Dae @ 2014-06-18  5:23 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: spk.linux, sw0312.kim, dri-devel

On 2014년 06월 17일 20:38, Sachin Kamat wrote:
> 'exynos_drm_pdev' was not getting unregistered if platform_driver_register()
> failed. Fix the ordering to allow this. This also fixes the below warning by
> moving the #endif macro. While at it also fix the ordering in the exit function
> so that de-registration happens in opposite order of registration.
> drivers/gpu/drm/exynos/exynos_drm_drv.c:768:1: warning: label ‘err_unregister_pd’ defined but not used [-Wunused-label]

Above line doesn't conform to UTF-8 so I just fixed it. :)
Applied.

Thanks,
Inki Dae

> Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
> ---
>  drivers/gpu/drm/exynos/exynos_drm_drv.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> index 5d225dd5..f72ca0c 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> @@ -765,24 +765,24 @@ static int exynos_drm_init(void)
>  
>  	return 0;
>  
> -err_unregister_pd:
> -	platform_device_unregister(exynos_drm_pdev);
> -
>  err_remove_vidi:
>  #ifdef CONFIG_DRM_EXYNOS_VIDI
>  	exynos_drm_remove_vidi();
> +
> +err_unregister_pd:
>  #endif
> +	platform_device_unregister(exynos_drm_pdev);
>  
>  	return ret;
>  }
>  
>  static void exynos_drm_exit(void)
>  {
> +	platform_driver_unregister(&exynos_drm_platform_driver);
>  #ifdef CONFIG_DRM_EXYNOS_VIDI
>  	exynos_drm_remove_vidi();
>  #endif
>  	platform_device_unregister(exynos_drm_pdev);
> -	platform_driver_unregister(&exynos_drm_platform_driver);
>  }
>  
>  module_init(exynos_drm_init);
> 

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH 1/1] drm/exynos: Fix de-registration ordering
  2014-06-18  5:23 ` Inki Dae
@ 2014-06-18  5:27   ` Sachin Kamat
  0 siblings, 0 replies; 3+ messages in thread
From: Sachin Kamat @ 2014-06-18  5:27 UTC (permalink / raw)
  To: Inki Dae; +Cc: sw0312.kim, dri-devel

On Wed, Jun 18, 2014 at 10:53 AM, Inki Dae <inki.dae@samsung.com> wrote:
> On 2014년 06월 17일 20:38, Sachin Kamat wrote:
>> 'exynos_drm_pdev' was not getting unregistered if platform_driver_register()
>> failed. Fix the ordering to allow this. This also fixes the below warning by
>> moving the #endif macro. While at it also fix the ordering in the exit function
>> so that de-registration happens in opposite order of registration.
>> drivers/gpu/drm/exynos/exynos_drm_drv.c:768:1: warning: label ‘err_unregister_pd’ defined but not used [-Wunused-label]
>
> Above line doesn't conform to UTF-8 so I just fixed it. :)
> Applied.

Thanks Inki :)

Regards,
Sachin
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2014-06-18  5:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-17 11:38 [PATCH 1/1] drm/exynos: Fix de-registration ordering Sachin Kamat
2014-06-18  5:23 ` Inki Dae
2014-06-18  5:27   ` Sachin Kamat

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).