aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeung-Woo Kim <sw0312.kim@samsung.com>2013-04-22 05:40:34 -0400
committerInki Dae <inki.dae@samsung.com>2013-04-29 01:35:32 -0400
commit0f6f95922e4def60b9e55cecc1fdbaacda9c426d (patch)
tree28550b7453863c2b4cf99f0027ad35b7ac6dbf5d
parent1055f49e9953e5a55e8b7d54db19c4b8c1108eec (diff)
exynos/drm: hdmi: cleanup for hdmi common device registration
The hdmi common device registration function does not need extern definition and for error case and unregister case, exynos_drm_hdmi_pdev should be cleared. Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_drv.h2
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_hdmi.c14
2 files changed, 11 insertions, 5 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index 4606fac7241a..635d4c516798 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
@@ -322,7 +322,7 @@ void exynos_drm_subdrv_close(struct drm_device *dev, struct drm_file *file);
322 * this function registers exynos drm hdmi platform device. It ensures only one 322 * this function registers exynos drm hdmi platform device. It ensures only one
323 * instance of the device is created. 323 * instance of the device is created.
324 */ 324 */
325extern int exynos_platform_device_hdmi_register(void); 325int exynos_platform_device_hdmi_register(void);
326 326
327/* 327/*
328 * this function unregisters exynos drm hdmi platform device if it exists. 328 * this function unregisters exynos drm hdmi platform device if it exists.
diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
index 6986a1b92885..ba2f0f1aa05f 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
@@ -51,21 +51,27 @@ struct drm_hdmi_context {
51 51
52int exynos_platform_device_hdmi_register(void) 52int exynos_platform_device_hdmi_register(void)
53{ 53{
54 struct platform_device *pdev;
55
54 if (exynos_drm_hdmi_pdev) 56 if (exynos_drm_hdmi_pdev)
55 return -EEXIST; 57 return -EEXIST;
56 58
57 exynos_drm_hdmi_pdev = platform_device_register_simple( 59 pdev = platform_device_register_simple(
58 "exynos-drm-hdmi", -1, NULL, 0); 60 "exynos-drm-hdmi", -1, NULL, 0);
59 if (IS_ERR(exynos_drm_hdmi_pdev)) 61 if (IS_ERR(pdev))
60 return PTR_ERR(exynos_drm_hdmi_pdev); 62 return PTR_ERR(pdev);
63
64 exynos_drm_hdmi_pdev = pdev;
61 65
62 return 0; 66 return 0;
63} 67}
64 68
65void exynos_platform_device_hdmi_unregister(void) 69void exynos_platform_device_hdmi_unregister(void)
66{ 70{
67 if (exynos_drm_hdmi_pdev) 71 if (exynos_drm_hdmi_pdev) {
68 platform_device_unregister(exynos_drm_hdmi_pdev); 72 platform_device_unregister(exynos_drm_hdmi_pdev);
73 exynos_drm_hdmi_pdev = NULL;
74 }
69} 75}
70 76
71void exynos_hdmi_drv_attach(struct exynos_drm_hdmi_context *ctx) 77void exynos_hdmi_drv_attach(struct exynos_drm_hdmi_context *ctx)