drm/exynos: remove module of exynos drm subdrv
authorJoonyoung Shim <jy0922.shim@samsung.com>
Fri, 16 Mar 2012 09:47:08 +0000 (18:47 +0900)
committerDave Airlie <airlied@redhat.com>
Tue, 20 Mar 2012 09:40:23 +0000 (09:40 +0000)
The exynos drm driver has several subdrv. They each can be module but it
causes unfixed probe order of exynodr drm driver and each subdrv. It
also needs some weird codes such as exynos_drm_fbdev_reinit and
exynos_drm_mode_group_reinit. This patch can remove weird codes and
clear codes through we doesn't modularity each subdrv.

Also this removes unnecessary codes related module.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
16 files changed:
drivers/gpu/drm/exynos/Kconfig
drivers/gpu/drm/exynos/Makefile
drivers/gpu/drm/exynos/exynos_ddc.c
drivers/gpu/drm/exynos/exynos_drm_connector.c
drivers/gpu/drm/exynos/exynos_drm_core.c
drivers/gpu/drm/exynos/exynos_drm_crtc.c
drivers/gpu/drm/exynos/exynos_drm_drv.c
drivers/gpu/drm/exynos/exynos_drm_drv.h
drivers/gpu/drm/exynos/exynos_drm_encoder.c
drivers/gpu/drm/exynos/exynos_drm_fb.c
drivers/gpu/drm/exynos/exynos_drm_fbdev.c
drivers/gpu/drm/exynos/exynos_drm_fimd.c
drivers/gpu/drm/exynos/exynos_drm_gem.c
drivers/gpu/drm/exynos/exynos_drm_hdmi.c
drivers/gpu/drm/exynos/exynos_hdmi.c
drivers/gpu/drm/exynos/exynos_mixer.c

index b9e5266c341baae491412e1fe75887c270b1fdb7..9a9850afe2f000cbc24a756410eeb6be1b4612df 100644 (file)
@@ -1,7 +1,6 @@
 config DRM_EXYNOS
        tristate "DRM Support for Samsung SoC EXYNOS Series"
        depends on DRM && PLAT_SAMSUNG
-       default n
        select DRM_KMS_HELPER
        select FB_CFB_FILLRECT
        select FB_CFB_COPYAREA
@@ -12,16 +11,13 @@ config DRM_EXYNOS
          If M is selected the module will be called exynosdrm.
 
 config DRM_EXYNOS_FIMD
-       tristate "Exynos DRM FIMD"
+       bool "Exynos DRM FIMD"
        depends on DRM_EXYNOS && !FB_S3C
-       default n
        help
          Choose this option if you want to use Exynos FIMD for DRM.
-         If M is selected, the module will be called exynos_drm_fimd
 
 config DRM_EXYNOS_HDMI
-       tristate "Exynos DRM HDMI"
+       bool "Exynos DRM HDMI"
        depends on DRM_EXYNOS && !VIDEO_SAMSUNG_S5P_TV
        help
          Choose this option if you want to use Exynos HDMI for DRM.
-         If M is selected, the module will be called exynos_drm_hdmi
index 395e69c9a96e63daea257add8befa40acdc80640..5331fa33e13a9426ef733982771959dc7d58910b 100644 (file)
@@ -8,7 +8,9 @@ exynosdrm-y := exynos_drm_drv.o exynos_drm_encoder.o exynos_drm_connector.o \
                exynos_drm_buf.o exynos_drm_gem.o exynos_drm_core.o \
                exynos_drm_plane.o
 
-obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o
-obj-$(CONFIG_DRM_EXYNOS_FIMD) += exynos_drm_fimd.o
-obj-$(CONFIG_DRM_EXYNOS_HDMI) += exynos_hdmi.o exynos_mixer.o exynos_ddc.o \
-                                exynos_hdmiphy.o exynos_drm_hdmi.o
+exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD)    += exynos_drm_fimd.o
+exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI)    += exynos_hdmi.o exynos_mixer.o \
+                                          exynos_ddc.o exynos_hdmiphy.o \
+                                          exynos_drm_hdmi.o
+
+obj-$(CONFIG_DRM_EXYNOS)               += exynosdrm.o
index 84b614fe26fd2f4e88a0f6e68a245ab929a1e01e..7e1051d07f1f85b3ee8827f006093a2a10d66413 100644 (file)
@@ -55,4 +55,3 @@ struct i2c_driver ddc_driver = {
        .remove         = __devexit_p(s5p_ddc_remove),
        .command                = NULL,
 };
-EXPORT_SYMBOL(ddc_driver);
index ebdd71d5068572e7d03bcb613ec90c4bcee73f38..a5d65912f4d572b9dea2b0fd75be578212efe93e 100644 (file)
@@ -348,9 +348,3 @@ err_connector:
        kfree(exynos_connector);
        return NULL;
 }
-
-MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
-MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
-MODULE_AUTHOR("Seung-Woo Kim <sw0312.kim@samsung.com>");
-MODULE_DESCRIPTION("Samsung SoC DRM Connector Driver");
-MODULE_LICENSE("GPL");
index d08a55896d50adce1345902bbe8072c399179378..937b0597c8b32f28b920c73f2050c0a1a65ff5f9 100644 (file)
@@ -32,7 +32,6 @@
 #include "exynos_drm_connector.h"
 #include "exynos_drm_fbdev.h"
 
-static DEFINE_MUTEX(exynos_drm_mutex);
 static LIST_HEAD(exynos_drm_subdrv_list);
 static struct drm_device *drm_dev;
 
@@ -116,13 +115,10 @@ int exynos_drm_device_register(struct drm_device *dev)
        if (!dev)
                return -EINVAL;
 
-       if (drm_dev) {
-               DRM_ERROR("Already drm device were registered\n");
-               return -EBUSY;
-       }
+       drm_dev = dev;
 
-       mutex_lock(&exynos_drm_mutex);
        list_for_each_entry_safe(subdrv, n, &exynos_drm_subdrv_list, list) {
+               subdrv->drm_dev = dev;
                err = exynos_drm_subdrv_probe(dev, subdrv);
                if (err) {
                        DRM_DEBUG("exynos drm subdrv probe failed.\n");
@@ -130,9 +126,6 @@ int exynos_drm_device_register(struct drm_device *dev)
                }
        }
 
-       drm_dev = dev;
-       mutex_unlock(&exynos_drm_mutex);
-
        return 0;
 }
 EXPORT_SYMBOL_GPL(exynos_drm_device_register);
@@ -143,86 +136,28 @@ int exynos_drm_device_unregister(struct drm_device *dev)
 
        DRM_DEBUG_DRIVER("%s\n", __FILE__);
 
-       if (!dev || dev != drm_dev) {
+       if (!dev) {
                WARN(1, "Unexpected drm device unregister!\n");
                return -EINVAL;
        }
 
-       mutex_lock(&exynos_drm_mutex);
        list_for_each_entry(subdrv, &exynos_drm_subdrv_list, list)
                exynos_drm_subdrv_remove(dev, subdrv);
 
        drm_dev = NULL;
-       mutex_unlock(&exynos_drm_mutex);
 
        return 0;
 }
 EXPORT_SYMBOL_GPL(exynos_drm_device_unregister);
 
-static int exynos_drm_mode_group_reinit(struct drm_device *dev)
-{
-       struct drm_mode_group *group = &dev->primary->mode_group;
-       uint32_t *id_list = group->id_list;
-       int ret;
-
-       DRM_DEBUG_DRIVER("%s\n", __FILE__);
-
-       ret = drm_mode_group_init_legacy_group(dev, group);
-       if (ret < 0)
-               return ret;
-
-       kfree(id_list);
-       return 0;
-}
-
 int exynos_drm_subdrv_register(struct exynos_drm_subdrv *subdrv)
 {
-       int err;
-
        DRM_DEBUG_DRIVER("%s\n", __FILE__);
 
        if (!subdrv)
                return -EINVAL;
 
-       mutex_lock(&exynos_drm_mutex);
-       if (drm_dev) {
-               err = exynos_drm_subdrv_probe(drm_dev, subdrv);
-               if (err) {
-                       DRM_ERROR("failed to probe exynos drm subdrv\n");
-                       mutex_unlock(&exynos_drm_mutex);
-                       return err;
-               }
-
-               /* setup possible_clones. */
-               exynos_drm_encoder_setup(drm_dev);
-
-               /*
-                * if any specific driver such as fimd or hdmi driver called
-                * exynos_drm_subdrv_register() later than drm_load(),
-                * the fb helper should be re-initialized and re-configured.
-                */
-               err = exynos_drm_fbdev_reinit(drm_dev);
-               if (err) {
-                       DRM_ERROR("failed to reinitialize exynos drm fbdev\n");
-                       exynos_drm_subdrv_remove(drm_dev, subdrv);
-                       mutex_unlock(&exynos_drm_mutex);
-                       return err;
-               }
-
-               err = exynos_drm_mode_group_reinit(drm_dev);
-               if (err) {
-                       DRM_ERROR("failed to reinitialize mode group\n");
-                       exynos_drm_fbdev_fini(drm_dev);
-                       exynos_drm_subdrv_remove(drm_dev, subdrv);
-                       mutex_unlock(&exynos_drm_mutex);
-                       return err;
-               }
-       }
-
-       subdrv->drm_dev = drm_dev;
-
        list_add_tail(&subdrv->list, &exynos_drm_subdrv_list);
-       mutex_unlock(&exynos_drm_mutex);
 
        return 0;
 }
@@ -230,46 +165,13 @@ EXPORT_SYMBOL_GPL(exynos_drm_subdrv_register);
 
 int exynos_drm_subdrv_unregister(struct exynos_drm_subdrv *subdrv)
 {
-       int ret = -EFAULT;
-
        DRM_DEBUG_DRIVER("%s\n", __FILE__);
 
-       if (!subdrv) {
-               DRM_DEBUG("Unexpected exynos drm subdrv unregister!\n");
-               return ret;
-       }
-
-       mutex_lock(&exynos_drm_mutex);
-       if (drm_dev) {
-               exynos_drm_subdrv_remove(drm_dev, subdrv);
-               list_del(&subdrv->list);
-
-               /*
-                * fb helper should be updated once a sub driver is released
-                * to re-configure crtc and connector and also to re-setup
-                * drm framebuffer.
-                */
-               ret = exynos_drm_fbdev_reinit(drm_dev);
-               if (ret < 0) {
-                       DRM_ERROR("failed fb helper reinit.\n");
-                       goto fail;
-               }
+       if (!subdrv)
+               return -EINVAL;
 
-               ret = exynos_drm_mode_group_reinit(drm_dev);
-               if (ret < 0) {
-                       DRM_ERROR("failed drm mode group reinit.\n");
-                       goto fail;
-               }
-       }
+       list_del(&subdrv->list);
 
-fail:
-       mutex_unlock(&exynos_drm_mutex);
-       return ret;
+       return 0;
 }
 EXPORT_SYMBOL_GPL(exynos_drm_subdrv_unregister);
-
-MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
-MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
-MODULE_AUTHOR("Seung-Woo Kim <sw0312.kim@samsung.com>");
-MODULE_DESCRIPTION("Samsung SoC DRM Core Driver");
-MODULE_LICENSE("GPL");
index 2d9a0e630d7f6b33b9ba4eb7be88166acc933149..3486ffed0bf05935082965327c11eb3b679a55af 100644 (file)
@@ -430,9 +430,3 @@ void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int crtc)
        exynos_drm_fn_encoder(private->crtc[crtc], &crtc,
                        exynos_drm_disable_vblank);
 }
-
-MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
-MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
-MODULE_AUTHOR("Seung-Woo Kim <sw0312.kim@samsung.com>");
-MODULE_DESCRIPTION("Samsung SoC DRM CRTC Driver");
-MODULE_LICENSE("GPL");
index d359cb4b7b88dfa727f295bad4e3bbf0369ee99d..903fcf0f05c7f436f720d1217108b07895ba922d 100644 (file)
@@ -266,9 +266,49 @@ static struct platform_driver exynos_drm_platform_driver = {
 
 static int __init exynos_drm_init(void)
 {
+       int ret;
+
        DRM_DEBUG_DRIVER("%s\n", __FILE__);
 
-       return platform_driver_register(&exynos_drm_platform_driver);
+#ifdef CONFIG_DRM_EXYNOS_FIMD
+       ret = platform_driver_register(&fimd_driver);
+       if (ret < 0)
+               goto out_fimd;
+#endif
+
+#ifdef CONFIG_DRM_EXYNOS_HDMI
+       ret = platform_driver_register(&hdmi_driver);
+       if (ret < 0)
+               goto out_hdmi;
+       ret = platform_driver_register(&mixer_driver);
+       if (ret < 0)
+               goto out_mixer;
+       ret = platform_driver_register(&exynos_drm_common_hdmi_driver);
+       if (ret < 0)
+               goto out_common_hdmi;
+#endif
+
+       ret = platform_driver_register(&exynos_drm_platform_driver);
+       if (ret < 0)
+               goto out;
+
+       return 0;
+
+out:
+#ifdef CONFIG_DRM_EXYNOS_HDMI
+       platform_driver_unregister(&exynos_drm_common_hdmi_driver);
+out_common_hdmi:
+       platform_driver_unregister(&mixer_driver);
+out_mixer:
+       platform_driver_unregister(&hdmi_driver);
+out_hdmi:
+#endif
+
+#ifdef CONFIG_DRM_EXYNOS_FIMD
+       platform_driver_unregister(&fimd_driver);
+out_fimd:
+#endif
+       return ret;
 }
 
 static void __exit exynos_drm_exit(void)
@@ -276,6 +316,16 @@ static void __exit exynos_drm_exit(void)
        DRM_DEBUG_DRIVER("%s\n", __FILE__);
 
        platform_driver_unregister(&exynos_drm_platform_driver);
+
+#ifdef CONFIG_DRM_EXYNOS_HDMI
+       platform_driver_unregister(&exynos_drm_common_hdmi_driver);
+       platform_driver_unregister(&mixer_driver);
+       platform_driver_unregister(&hdmi_driver);
+#endif
+
+#ifdef CONFIG_DRM_EXYNOS_FIMD
+       platform_driver_unregister(&fimd_driver);
+#endif
 }
 
 module_init(exynos_drm_init);
index 4115a9f61d21179e507e57af64f377c31a9584b2..f8bac0eb2cb2a55869d5471fe99ff8dde8782dca 100644 (file)
@@ -262,15 +262,15 @@ int exynos_drm_device_unregister(struct drm_device *dev);
  * this function would be called by sub drivers such as display controller
  * or hdmi driver to register this sub driver object to exynos drm driver
  * and when a sub driver is registered to exynos drm driver a probe callback
- * of the sub driver is called and creates its own encoder and connector
- * and then fb helper and drm mode group would be re-initialized.
+ * of the sub driver is called and creates its own encoder and connector.
  */
 int exynos_drm_subdrv_register(struct exynos_drm_subdrv *drm_subdrv);
 
-/*
- * this function removes subdrv list from exynos drm driver and fb helper
- * and drm mode group would be re-initialized.
- */
+/* this function removes subdrv list from exynos drm driver */
 int exynos_drm_subdrv_unregister(struct exynos_drm_subdrv *drm_subdrv);
 
+extern struct platform_driver fimd_driver;
+extern struct platform_driver hdmi_driver;
+extern struct platform_driver mixer_driver;
+extern struct platform_driver exynos_drm_common_hdmi_driver;
 #endif
index 45ca732858fb3ee2d53489d97510c65c129e556b..22786765d40519f2a16da9d01e78b2519c2440b6 100644 (file)
@@ -442,9 +442,3 @@ void exynos_drm_encoder_crtc_disable(struct drm_encoder *encoder, void *data)
        if (overlay_ops && overlay_ops->disable)
                overlay_ops->disable(manager->dev, zpos);
 }
-
-MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
-MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
-MODULE_AUTHOR("Seung-Woo Kim <sw0312.kim@samsung.com>");
-MODULE_DESCRIPTION("Samsung SoC DRM Encoder Driver");
-MODULE_LICENSE("GPL");
index 3733fe6723d32cee58091135dad7abfd28672843..c38c8f468fa35351d89a1f3309cee0fa358a960c 100644 (file)
@@ -211,9 +211,3 @@ void exynos_drm_mode_config_init(struct drm_device *dev)
 
        dev->mode_config.funcs = &exynos_drm_mode_config_funcs;
 }
-
-MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
-MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
-MODULE_AUTHOR("Seung-Woo Kim <sw0312.kim@samsung.com>");
-MODULE_DESCRIPTION("Samsung SoC DRM FB Driver");
-MODULE_LICENSE("GPL");
index b5dcd5384781d8b252ce2299debaf6e072b6d475..d5586cc751635e9ab858d2b3880e39b2c672e1e4 100644 (file)
@@ -316,89 +316,3 @@ void exynos_drm_fbdev_restore_mode(struct drm_device *dev)
 
        drm_fb_helper_restore_fbdev_mode(private->fb_helper);
 }
-
-int exynos_drm_fbdev_reinit(struct drm_device *dev)
-{
-       struct exynos_drm_private *private = dev->dev_private;
-       struct drm_fb_helper *fb_helper;
-       int ret;
-
-       if (!private)
-               return -EINVAL;
-
-       /*
-        * if all sub drivers were unloaded then num_connector is 0
-        * so at this time, the framebuffers also should be destroyed.
-        */
-       if (!dev->mode_config.num_connector) {
-               exynos_drm_fbdev_fini(dev);
-               return 0;
-       }
-
-       fb_helper = private->fb_helper;
-
-       if (fb_helper) {
-               struct list_head temp_list;
-
-               INIT_LIST_HEAD(&temp_list);
-
-               /*
-                * fb_helper is reintialized but kernel fb is reused
-                * so kernel_fb_list need to be backuped and restored
-                */
-               if (!list_empty(&fb_helper->kernel_fb_list))
-                       list_replace_init(&fb_helper->kernel_fb_list,
-                                       &temp_list);
-
-               drm_fb_helper_fini(fb_helper);
-
-               ret = drm_fb_helper_init(dev, fb_helper,
-                               dev->mode_config.num_crtc, MAX_CONNECTOR);
-               if (ret < 0) {
-                       DRM_ERROR("failed to initialize drm fb helper\n");
-                       return ret;
-               }
-
-               if (!list_empty(&temp_list))
-                       list_replace(&temp_list, &fb_helper->kernel_fb_list);
-
-               ret = drm_fb_helper_single_add_all_connectors(fb_helper);
-               if (ret < 0) {
-                       DRM_ERROR("failed to add fb helper to connectors\n");
-                       goto err;
-               }
-
-               ret = drm_fb_helper_initial_config(fb_helper, PREFERRED_BPP);
-               if (ret < 0) {
-                       DRM_ERROR("failed to set up hw configuration.\n");
-                       goto err;
-               }
-       } else {
-               /*
-                * if drm_load() failed whem drm load() was called prior
-                * to specific drivers, fb_helper must be NULL and so
-                * this fuction should be called again to re-initialize and
-                * re-configure the fb helper. it means that this function
-                * has been called by the specific drivers.
-                */
-               ret = exynos_drm_fbdev_init(dev);
-       }
-
-       return ret;
-
-err:
-       /*
-        * if drm_load() failed when drm load() was called prior
-        * to specific drivers, the fb_helper must be NULL and so check it.
-        */
-       if (fb_helper)
-               drm_fb_helper_fini(fb_helper);
-
-       return ret;
-}
-
-MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
-MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
-MODULE_AUTHOR("Seung-Woo Kim <sw0312.kim@samsung.com>");
-MODULE_DESCRIPTION("Samsung SoC DRM FBDEV Driver");
-MODULE_LICENSE("GPL");
index 360adf2bba047bb9c60177bc1a7dff8965ba3fd1..101d64c7a9bee20787b24f3de28e287242071e8e 100644 (file)
@@ -1012,7 +1012,7 @@ static const struct dev_pm_ops fimd_pm_ops = {
        SET_RUNTIME_PM_OPS(fimd_runtime_suspend, fimd_runtime_resume, NULL)
 };
 
-static struct platform_driver fimd_driver = {
+struct platform_driver fimd_driver = {
        .probe          = fimd_probe,
        .remove         = __devexit_p(fimd_remove),
        .driver         = {
@@ -1021,21 +1021,3 @@ static struct platform_driver fimd_driver = {
                .pm     = &fimd_pm_ops,
        },
 };
-
-static int __init fimd_init(void)
-{
-       return platform_driver_register(&fimd_driver);
-}
-
-static void __exit fimd_exit(void)
-{
-       platform_driver_unregister(&fimd_driver);
-}
-
-module_init(fimd_init);
-module_exit(fimd_exit);
-
-MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
-MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
-MODULE_DESCRIPTION("Samsung DRM FIMD Driver");
-MODULE_LICENSE("GPL");
index b5c6f3cfc698decacfb053703262ebf40b9179ea..fa1aa94a3d8e3066f5abf21fdd02331b1d9b5219 100644 (file)
@@ -735,7 +735,3 @@ int exynos_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma)
 
        return ret;
 }
-
-MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
-MODULE_DESCRIPTION("Samsung SoC DRM GEM Module");
-MODULE_LICENSE("GPL");
index ed86bddf81daaaeef447606ee40a2774d314bccc..14eb26b0ba1cb1fc70fb533be2adb38fd935ac71 100644 (file)
@@ -38,7 +38,6 @@ struct drm_hdmi_context {
        struct exynos_drm_subdrv        subdrv;
        struct exynos_drm_hdmi_context  *hdmi_ctx;
        struct exynos_drm_hdmi_context  *mixer_ctx;
-       struct work_struct              work;
 };
 
 void exynos_drm_display_ops_register(struct exynos_hdmi_display_ops
@@ -49,7 +48,6 @@ void exynos_drm_display_ops_register(struct exynos_hdmi_display_ops
        if (display_ops)
                hdmi_display_ops = display_ops;
 }
-EXPORT_SYMBOL(exynos_drm_display_ops_register);
 
 void exynos_drm_manager_ops_register(struct exynos_hdmi_manager_ops
                                        *manager_ops)
@@ -59,7 +57,6 @@ void exynos_drm_manager_ops_register(struct exynos_hdmi_manager_ops
        if (manager_ops)
                hdmi_manager_ops = manager_ops;
 }
-EXPORT_SYMBOL(exynos_drm_manager_ops_register);
 
 void exynos_drm_overlay_ops_register(struct exynos_hdmi_overlay_ops
                                        *overlay_ops)
@@ -69,7 +66,6 @@ void exynos_drm_overlay_ops_register(struct exynos_hdmi_overlay_ops
        if (overlay_ops)
                hdmi_overlay_ops = overlay_ops;
 }
-EXPORT_SYMBOL(exynos_drm_overlay_ops_register);
 
 static bool drm_hdmi_is_connected(struct device *dev)
 {
@@ -277,7 +273,6 @@ static int hdmi_subdrv_probe(struct drm_device *drm_dev,
        struct drm_hdmi_context *ctx;
        struct platform_device *pdev = to_platform_device(dev);
        struct exynos_drm_common_hdmi_pd *pd;
-       int ret;
 
        DRM_DEBUG_KMS("%s\n", __FILE__);
 
@@ -298,26 +293,13 @@ static int hdmi_subdrv_probe(struct drm_device *drm_dev,
                return -EFAULT;
        }
 
-       ret = platform_driver_register(&hdmi_driver);
-       if (ret) {
-               DRM_DEBUG_KMS("failed to register hdmi driver.\n");
-               return ret;
-       }
-
-       ret = platform_driver_register(&mixer_driver);
-       if (ret) {
-               DRM_DEBUG_KMS("failed to register mixer driver.\n");
-               goto err_hdmidrv;
-       }
-
        ctx = get_ctx_from_subdrv(subdrv);
 
        ctx->hdmi_ctx = (struct exynos_drm_hdmi_context *)
                                to_context(pd->hdmi_dev);
        if (!ctx->hdmi_ctx) {
                DRM_DEBUG_KMS("hdmi context is null.\n");
-               ret = -EFAULT;
-               goto err_mixerdrv;
+               return -EFAULT;
        }
 
        ctx->hdmi_ctx->drm_dev = drm_dev;
@@ -326,42 +308,12 @@ static int hdmi_subdrv_probe(struct drm_device *drm_dev,
                                to_context(pd->mixer_dev);
        if (!ctx->mixer_ctx) {
                DRM_DEBUG_KMS("mixer context is null.\n");
-               ret = -EFAULT;
-               goto err_mixerdrv;
+               return -EFAULT;
        }
 
        ctx->mixer_ctx->drm_dev = drm_dev;
 
        return 0;
-
-err_mixerdrv:
-       platform_driver_unregister(&mixer_driver);
-err_hdmidrv:
-       platform_driver_unregister(&hdmi_driver);
-       return ret;
-}
-
-static void hdmi_subdrv_remove(struct drm_device *drm_dev)
-{
-       DRM_DEBUG_KMS("%s\n", __FILE__);
-
-       platform_driver_unregister(&hdmi_driver);
-       platform_driver_unregister(&mixer_driver);
-}
-
-static void exynos_drm_hdmi_late_probe(struct work_struct *work)
-{
-       struct drm_hdmi_context *ctx = container_of(work,
-                               struct drm_hdmi_context, work);
-
-       /*
-        * this function calls subdrv->probe() so this must be called
-        * after probe context.
-        *
-        * PS. subdrv->probe() will call platform_driver_register() to probe
-        * hdmi and mixer driver.
-        */
-       exynos_drm_subdrv_register(&ctx->subdrv);
 }
 
 static int __devinit exynos_drm_hdmi_probe(struct platform_device *pdev)
@@ -381,7 +333,6 @@ static int __devinit exynos_drm_hdmi_probe(struct platform_device *pdev)
        subdrv = &ctx->subdrv;
 
        subdrv->probe = hdmi_subdrv_probe;
-       subdrv->remove = hdmi_subdrv_remove;
        subdrv->manager.pipe = -1;
        subdrv->manager.ops = &drm_hdmi_manager_ops;
        subdrv->manager.overlay_ops = &drm_hdmi_overlay_ops;
@@ -390,9 +341,7 @@ static int __devinit exynos_drm_hdmi_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, subdrv);
 
-       INIT_WORK(&ctx->work, exynos_drm_hdmi_late_probe);
-
-       schedule_work(&ctx->work);
+       exynos_drm_subdrv_register(subdrv);
 
        return 0;
 }
@@ -428,7 +377,7 @@ static int __devexit exynos_drm_hdmi_remove(struct platform_device *pdev)
        return 0;
 }
 
-static struct platform_driver exynos_drm_common_hdmi_driver = {
+struct platform_driver exynos_drm_common_hdmi_driver = {
        .probe          = exynos_drm_hdmi_probe,
        .remove         = __devexit_p(exynos_drm_hdmi_remove),
        .driver         = {
@@ -437,31 +386,3 @@ static struct platform_driver exynos_drm_common_hdmi_driver = {
                .pm = &hdmi_pm_ops,
        },
 };
-
-static int __init exynos_drm_hdmi_init(void)
-{
-       int ret;
-
-       DRM_DEBUG_KMS("%s\n", __FILE__);
-
-       ret = platform_driver_register(&exynos_drm_common_hdmi_driver);
-       if (ret) {
-               DRM_DEBUG_KMS("failed to register hdmi common driver.\n");
-               return ret;
-       }
-
-       return ret;
-}
-
-static void __exit exynos_drm_hdmi_exit(void)
-{
-       platform_driver_unregister(&exynos_drm_common_hdmi_driver);
-}
-
-module_init(exynos_drm_hdmi_init);
-module_exit(exynos_drm_hdmi_exit);
-
-MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
-MODULE_AUTHOR("Seung-Woo Kim, <sw0312.kim@samsung.com>");
-MODULE_DESCRIPTION("Samsung SoC DRM HDMI Driver");
-MODULE_LICENSE("GPL");
index 6fe1e8993c92c884519a1d743497b10c6e2e84f6..3fe5b2e72f1e1331363574bb919f85a2ad315b99 100644 (file)
@@ -1998,14 +1998,12 @@ void hdmi_attach_ddc_client(struct i2c_client *ddc)
        if (ddc)
                hdmi_ddc = ddc;
 }
-EXPORT_SYMBOL(hdmi_attach_ddc_client);
 
 void hdmi_attach_hdmiphy_client(struct i2c_client *hdmiphy)
 {
        if (hdmiphy)
                hdmi_hdmiphy = hdmiphy;
 }
-EXPORT_SYMBOL(hdmi_attach_hdmiphy_client);
 
 static int __devinit hdmi_probe(struct platform_device *pdev)
 {
@@ -2188,10 +2186,3 @@ struct platform_driver hdmi_driver = {
                .pm = &hdmi_pm_ops,
        },
 };
-EXPORT_SYMBOL(hdmi_driver);
-
-MODULE_AUTHOR("Seung-Woo Kim, <sw0312.kim@samsung.com>");
-MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
-MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
-MODULE_DESCRIPTION("Samsung DRM HDMI core Driver");
-MODULE_LICENSE("GPL");
index 45cbe3f38225c248ed60d2ccd631453ba16315a4..f42c43741b6d714f0c27474641b41aa421693371 100644 (file)
@@ -1113,10 +1113,3 @@ struct platform_driver mixer_driver = {
        .probe = mixer_probe,
        .remove = __devexit_p(mixer_remove),
 };
-EXPORT_SYMBOL(mixer_driver);
-
-MODULE_AUTHOR("Seung-Woo Kim, <sw0312.kim@samsung.com>");
-MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
-MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
-MODULE_DESCRIPTION("Samsung DRM HDMI mixer Driver");
-MODULE_LICENSE("GPL");