diff options
author | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2015-08-05 20:24:20 -0300 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2015-08-16 10:23:37 +0900 |
commit | a2986e8032bddbe237ed16e2e26c71f5416cd5fd (patch) | |
tree | e52b61cf865f2a2bec677b148852bb597fefb62a /drivers/gpu/drm/exynos/exynos_drm_dsi.c | |
parent | af8be3f6fe80262f29b5e353421392196ff626f0 (diff) | |
download | op-kernel-dev-a2986e8032bddbe237ed16e2e26c71f5416cd5fd.zip op-kernel-dev-a2986e8032bddbe237ed16e2e26c71f5416cd5fd.tar.gz |
drm/exynos: remove exynos_drm_create_enc_conn()
This functions was just hiding the encoder and connector creation in
a way that was less clean than if we get rid of it. For example,
exynos_encoder ops had .create_connector() defined only because we were
handing off the encoder and connector creation to
exynos_drm_create_enc_conn(). Without this function we can directly call
the create_connector function internally in the code, without the need of
any vtable access.
It also does some refactoring in the code like creating a bind function
for dpi devices.
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_dsi.c')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_dsi.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index fef3a61..d791ad4 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -30,6 +30,7 @@ #include <video/videomode.h> #include "exynos_drm_crtc.h" +#include "exynos_drm_encoder.h" #include "exynos_drm_drv.h" /* returns true iff both arguments logically differs */ @@ -1678,7 +1679,6 @@ static void exynos_dsi_mode_set(struct exynos_drm_encoder *encoder, } static struct exynos_drm_encoder_ops exynos_dsi_encoder_ops = { - .create_connector = exynos_dsi_create_connector, .mode_set = exynos_dsi_mode_set, .enable = exynos_dsi_enable, .disable = exynos_dsi_disable, @@ -1804,17 +1804,23 @@ end: static int exynos_dsi_bind(struct device *dev, struct device *master, void *data) { - struct exynos_drm_encoder *encoder = dev_get_drvdata(dev); - struct exynos_dsi *dsi = encoder_to_dsi(encoder); + struct exynos_drm_encoder *exynos_encoder = dev_get_drvdata(dev); + struct exynos_dsi *dsi = encoder_to_dsi(exynos_encoder); struct drm_device *drm_dev = data; struct drm_bridge *bridge; int ret; - ret = exynos_drm_create_enc_conn(drm_dev, encoder, - EXYNOS_DISPLAY_TYPE_LCD); + ret = exynos_drm_encoder_create(drm_dev, exynos_encoder, + EXYNOS_DISPLAY_TYPE_LCD); + if (ret) { + DRM_ERROR("failed to create encoder\n"); + return ret; + } + + ret = exynos_dsi_create_connector(exynos_encoder); if (ret) { - DRM_ERROR("Encoder create [%d] failed with %d\n", - EXYNOS_DISPLAY_TYPE_LCD, ret); + DRM_ERROR("failed to create connector ret = %d\n", ret); + drm_encoder_cleanup(&exynos_encoder->base); return ret; } |