Message ID | 1349982119-10791-1-git-send-email-rahul.sharma@samsung.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
2012? 10? 12? ???? Rahul Sharma?? ??: > This patch moved the exynos-drm-hdmi platform device registration to the > drm > driver. When DT is enabled, platform devices needs to be registered within > the > driver code. This patch fits the requirement of both DT and Non DT based > drm > drivers. > > Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com <javascript:;>> > --- > drivers/gpu/drm/exynos/exynos_drm_drv.c | 15 ++++++++++++++- > 1 files changed, 14 insertions(+), 1 deletions(-) > > diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c > b/drivers/gpu/drm/exynos/exynos_drm_drv.c > index 4200f15..643c47f 100644 > --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c > +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c > @@ -53,6 +53,9 @@ > /* platform device pointer for eynos drm device. */ > static struct platform_device *exynos_drm_pdev; > > +/* platform device pointer for common drm hdmi device. */ > +static struct platform_device *exynos_drm_hdmi_pdev; Is exynos_drm_hdmi_pdev related to exynos_drm_drv? I don't really like such thing. let's comply with layer rule. so how about moving exynos_drm_hdmi_pdev into exynos_drm_hdmi layer and just calling platform_device_hdmi_register instead of platform_device_register_simple? for this, exynos_drm_hdmi_pdev should be defined and declared in exynos_drm_hdmi layer. it means that we have one wrapper to common hdmi layer. + > static int exynos_drm_load(struct drm_device *dev, unsigned long flags) > { > struct exynos_drm_private *private; > @@ -329,6 +332,13 @@ static int __init exynos_drm_init(void) > ret = platform_driver_register(&exynos_drm_common_hdmi_driver); > if (ret < 0) > goto out_common_hdmi; > + > + exynos_drm_hdmi_pdev = platform_device_register_simple( > + "exynos-drm-hdmi", -1, NULL, 0); > + if (IS_ERR_OR_NULL(exynos_drm_hdmi_pdev)) { > + ret = PTR_ERR(exynos_drm_hdmi_pdev); > + goto out_common_hdmi_dev; > + } > #endif > > #ifdef CONFIG_DRM_EXYNOS_VIDI > @@ -366,11 +376,13 @@ out_g2d: > #endif > > #ifdef CONFIG_DRM_EXYNOS_VIDI > -out_vidi: > platform_driver_unregister(&vidi_driver); > +out_vidi: > #endif > > #ifdef CONFIG_DRM_EXYNOS_HDMI > + platform_device_unregister(exynos_drm_hdmi_pdev); > +out_common_hdmi_dev: > platform_driver_unregister(&exynos_drm_common_hdmi_driver); > out_common_hdmi: > platform_driver_unregister(&mixer_driver); > @@ -399,6 +411,7 @@ static void __exit exynos_drm_exit(void) > #endif > > #ifdef CONFIG_DRM_EXYNOS_HDMI > + platform_device_unregister(exynos_drm_hdmi_pdev); ditto. let's call platform_device_hdmi_unregister instead. > platform_driver_unregister(&exynos_drm_common_hdmi_driver); > platform_driver_unregister(&mixer_driver); > platform_driver_unregister(&hdmi_driver); > -- > 1.7.0.4 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org <javascript:;> > http://lists.freedesktop.org/mailman/listinfo/dri-devel >
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 4200f15..643c47f 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -53,6 +53,9 @@ /* platform device pointer for eynos drm device. */ static struct platform_device *exynos_drm_pdev; +/* platform device pointer for common drm hdmi device. */ +static struct platform_device *exynos_drm_hdmi_pdev; + static int exynos_drm_load(struct drm_device *dev, unsigned long flags) { struct exynos_drm_private *private; @@ -329,6 +332,13 @@ static int __init exynos_drm_init(void) ret = platform_driver_register(&exynos_drm_common_hdmi_driver); if (ret < 0) goto out_common_hdmi; + + exynos_drm_hdmi_pdev = platform_device_register_simple( + "exynos-drm-hdmi", -1, NULL, 0); + if (IS_ERR_OR_NULL(exynos_drm_hdmi_pdev)) { + ret = PTR_ERR(exynos_drm_hdmi_pdev); + goto out_common_hdmi_dev; + } #endif #ifdef CONFIG_DRM_EXYNOS_VIDI @@ -366,11 +376,13 @@ out_g2d: #endif #ifdef CONFIG_DRM_EXYNOS_VIDI -out_vidi: platform_driver_unregister(&vidi_driver); +out_vidi: #endif #ifdef CONFIG_DRM_EXYNOS_HDMI + platform_device_unregister(exynos_drm_hdmi_pdev); +out_common_hdmi_dev: platform_driver_unregister(&exynos_drm_common_hdmi_driver); out_common_hdmi: platform_driver_unregister(&mixer_driver); @@ -399,6 +411,7 @@ static void __exit exynos_drm_exit(void) #endif #ifdef CONFIG_DRM_EXYNOS_HDMI + platform_device_unregister(exynos_drm_hdmi_pdev); platform_driver_unregister(&exynos_drm_common_hdmi_driver); platform_driver_unregister(&mixer_driver); platform_driver_unregister(&hdmi_driver);
This patch moved the exynos-drm-hdmi platform device registration to the drm driver. When DT is enabled, platform devices needs to be registered within the driver code. This patch fits the requirement of both DT and Non DT based drm drivers. Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com> --- drivers/gpu/drm/exynos/exynos_drm_drv.c | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletions(-)