From: Laurent Pinchart Date: Thu, 24 Jun 2021 00:03:04 +0000 (+0300) Subject: drm/bridge: ti-sn65dsi86: Split connector creation to a function X-Git-Tag: accepted/tizen/unified/20230118.172025~6402^2~28^2~117 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=379d34264687db0b4bb404f9b3e6d5ea6e92ebaf;p=platform%2Fkernel%2Flinux-rpi.git drm/bridge: ti-sn65dsi86: Split connector creation to a function To prepare for making connector creation option, move connector creation out of ti_sn_bridge_attach to a separate function. No functional change intended. Signed-off-by: Laurent Pinchart Reviewed-by: Stephen Boyd Reviewed-by: Douglas Anderson Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20210624000304.16281-7-laurent.pinchart+renesas@ideasonboard.com --- diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c index feeda88..9bf88930 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -636,6 +636,25 @@ static const struct drm_connector_funcs ti_sn_bridge_connector_funcs = { .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, }; +static int ti_sn_bridge_connector_init(struct ti_sn65dsi86 *pdata) +{ + int ret; + + ret = drm_connector_init(pdata->bridge.dev, &pdata->connector, + &ti_sn_bridge_connector_funcs, + DRM_MODE_CONNECTOR_eDP); + if (ret) { + DRM_ERROR("Failed to initialize connector with drm\n"); + return ret; + } + + drm_connector_helper_add(&pdata->connector, + &ti_sn_bridge_connector_helper_funcs); + drm_connector_attach_encoder(&pdata->connector, pdata->bridge.encoder); + + return 0; +} + /*------------------------------------------------------------------------------ * DRM Bridge */ @@ -669,17 +688,9 @@ static int ti_sn_bridge_attach(struct drm_bridge *bridge, return ret; } - ret = drm_connector_init(bridge->dev, &pdata->connector, - &ti_sn_bridge_connector_funcs, - DRM_MODE_CONNECTOR_eDP); - if (ret) { - DRM_ERROR("Failed to initialize connector with drm\n"); + ret = ti_sn_bridge_connector_init(pdata); + if (ret < 0) goto err_conn_init; - } - - drm_connector_helper_add(&pdata->connector, - &ti_sn_bridge_connector_helper_funcs); - drm_connector_attach_encoder(&pdata->connector, bridge->encoder); /* * TODO: ideally finding host resource and dsi dev registration needs