summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/exynos/exynos_drm_vidi.c
diff options
context:
space:
mode:
authorGustavo Padovan <gustavo.padovan@collabora.co.uk>2015-08-05 20:24:20 -0300
committerInki Dae <inki.dae@samsung.com>2015-08-16 10:23:37 +0900
commita2986e8032bddbe237ed16e2e26c71f5416cd5fd (patch)
treee52b61cf865f2a2bec677b148852bb597fefb62a /drivers/gpu/drm/exynos/exynos_drm_vidi.c
parentaf8be3f6fe80262f29b5e353421392196ff626f0 (diff)
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_vidi.c')
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_vidi.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
index d7f9501ceb3a..9b64c7771516 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
@@ -389,15 +389,11 @@ static int vidi_create_connector(struct exynos_drm_encoder *exynos_encoder)
return 0;
}
-
-static struct exynos_drm_encoder_ops vidi_encoder_ops = {
- .create_connector = vidi_create_connector,
-};
-
static int vidi_bind(struct device *dev, struct device *master, void *data)
{
struct vidi_context *ctx = dev_get_drvdata(dev);
struct drm_device *drm_dev = data;
+ struct exynos_drm_encoder *exynos_encoder = &ctx->encoder;
struct exynos_drm_plane *exynos_plane;
enum drm_plane_type type;
unsigned int zpos;
@@ -423,10 +419,17 @@ static int vidi_bind(struct device *dev, struct device *master, void *data)
return PTR_ERR(ctx->crtc);
}
- ret = exynos_drm_create_enc_conn(drm_dev, &ctx->encoder,
- EXYNOS_DISPLAY_TYPE_VIDI);
+ ret = exynos_drm_encoder_create(drm_dev, exynos_encoder,
+ EXYNOS_DISPLAY_TYPE_VIDI);
+ if (ret) {
+ DRM_ERROR("failed to create encoder\n");
+ return ret;
+ }
+
+ ret = vidi_create_connector(exynos_encoder);
if (ret) {
- ctx->crtc->base.funcs->destroy(&ctx->crtc->base);
+ DRM_ERROR("failed to create connector ret = %d\n", ret);
+ drm_encoder_cleanup(&exynos_encoder->base);
return ret;
}
@@ -452,7 +455,6 @@ static int vidi_probe(struct platform_device *pdev)
if (!ctx)
return -ENOMEM;
- ctx->encoder.ops = &vidi_encoder_ops;
ctx->default_win = 0;
ctx->pdev = pdev;