From a2986e8032bddbe237ed16e2e26c71f5416cd5fd Mon Sep 17 00:00:00 2001 From: Gustavo Padovan Date: Wed, 5 Aug 2015 20:24:20 -0300 Subject: 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 Signed-off-by: Inki Dae --- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'drivers/gpu/drm/exynos/exynos_drm_vidi.c') 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; -- cgit v1.2.3