Commit b7ba5db9 authored by Stephen Boyd's avatar Stephen Boyd Committed by Dmitry Baryshkov

drm/msm/dp: Use drm_dp_read_sink_count() helper

Use the common function drm_dp_read_sink_count() instead of open-coding
it. This shrinks the kernel text a tiny bit.

Cc: Vinod Polimera <quic_vpolimer@quicinc.com>
Cc: Kuogee Hsieh <quic_khsieh@quicinc.com>
Signed-off-by: default avatarStephen Boyd <swboyd@chromium.org>
Tested-by: default avatarKuogee Hsieh <quic_khsieh@quicinc.com>
Reviewed-by: default avatarKuogee Hsieh <quic_khsieh@quicinc.com>
Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/554983/
Link: https://lore.kernel.org/r/20230829184735.2841739-3-swboyd@chromium.orgSigned-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
parent 744077f9
...@@ -147,8 +147,8 @@ static int dp_panel_update_modes(struct drm_connector *connector, ...@@ -147,8 +147,8 @@ static int dp_panel_update_modes(struct drm_connector *connector,
int dp_panel_read_sink_caps(struct dp_panel *dp_panel, int dp_panel_read_sink_caps(struct dp_panel *dp_panel,
struct drm_connector *connector) struct drm_connector *connector)
{ {
int rc = 0, bw_code; int rc, bw_code;
int rlen, count; int count;
struct dp_panel_private *panel; struct dp_panel_private *panel;
if (!dp_panel || !connector) { if (!dp_panel || !connector) {
...@@ -174,16 +174,11 @@ int dp_panel_read_sink_caps(struct dp_panel *dp_panel, ...@@ -174,16 +174,11 @@ int dp_panel_read_sink_caps(struct dp_panel *dp_panel,
} }
if (dp_panel->dfp_present) { if (dp_panel->dfp_present) {
rlen = drm_dp_dpcd_read(panel->aux, DP_SINK_COUNT, count = drm_dp_read_sink_count(panel->aux);
&count, 1); if (!count) {
if (rlen == 1) { DRM_ERROR("no downstream ports connected\n");
count = DP_GET_SINK_COUNT(count); panel->link->sink_count = 0;
if (!count) { return -ENOTCONN;
DRM_ERROR("no downstream ports connected\n");
panel->link->sink_count = 0;
rc = -ENOTCONN;
goto end;
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment