From: Stephen Boyd Date: Tue, 29 Aug 2023 18:47:30 +0000 (-0700) Subject: drm/msm/dp: Simplify with drm_dp_{max_link_rate, max_lane_count}() X-Git-Tag: v6.7-rc1~145^2~5^2~60 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=634e9da255fca11afd1894a8b6b352d81ebe7ae4;p=thirdparty%2Fkernel%2Flinux.git drm/msm/dp: Simplify with drm_dp_{max_link_rate, max_lane_count}() These are open-coded versions of common functions. Replace them with the common code to improve readability. Cc: Vinod Polimera Cc: Kuogee Hsieh Signed-off-by: Stephen Boyd Tested-by: Kuogee Hsieh Reviewed-by: Kuogee Hsieh Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/554990/ Link: https://lore.kernel.org/r/20230829184735.2841739-6-swboyd@chromium.org Signed-off-by: Dmitry Baryshkov --- diff --git a/drivers/gpu/drm/msm/dp/dp_panel.c b/drivers/gpu/drm/msm/dp/dp_panel.c index 0893522ae1583..97ba41593820e 100644 --- a/drivers/gpu/drm/msm/dp/dp_panel.c +++ b/drivers/gpu/drm/msm/dp/dp_panel.c @@ -58,8 +58,8 @@ static int dp_panel_read_dpcd(struct dp_panel *dp_panel) major = (link_info->revision >> 4) & 0x0f; minor = link_info->revision & 0x0f; - link_info->rate = drm_dp_bw_code_to_link_rate(dpcd[DP_MAX_LINK_RATE]); - link_info->num_lanes = dpcd[DP_MAX_LANE_COUNT] & DP_MAX_LANE_COUNT_MASK; + link_info->rate = drm_dp_max_link_rate(dpcd); + link_info->num_lanes = drm_dp_max_lane_count(dpcd); /* Limit data lanes from data-lanes of endpoint property of dtsi */ if (link_info->num_lanes > dp_panel->max_dp_lanes)