Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/msm/dp: Inline dp_link_parse_sink_count()

The function dp_link_parse_sink_count() is really just
drm_dp_read_sink_count(). It debug prints out the bit for content
protection (DP_SINK_CP_READY), but that is not useful beyond debug
because 'link->dp_link.sink_count' is overwritten to only contain the
sink_count in this same function. Just use drm_dp_read_sink_count() in
the one place this function is called to simplify.

Cc: Vinod Polimera <quic_vpolimer@quicinc.com>
Cc: Kuogee Hsieh <quic_khsieh@quicinc.com>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Tested-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
Reviewed-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/554987/
Link: https://lore.kernel.org/r/20230829184735.2841739-7-swboyd@chromium.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

authored by

Stephen Boyd and committed by
Dmitry Baryshkov
c0977e0d 634e9da2

+3 -35
+3 -35
drivers/gpu/drm/msm/dp/dp_link.c
··· 712 712 return ret; 713 713 } 714 714 715 - /** 716 - * dp_link_parse_sink_count() - parses the sink count 717 - * @dp_link: pointer to link module data 718 - * 719 - * Parses the DPCD to check if there is an update to the sink count 720 - * (Byte 0x200), and whether all the sink devices connected have Content 721 - * Protection enabled. 722 - */ 723 - static int dp_link_parse_sink_count(struct dp_link *dp_link) 724 - { 725 - ssize_t rlen; 726 - bool cp_ready; 727 - 728 - struct dp_link_private *link = container_of(dp_link, 729 - struct dp_link_private, dp_link); 730 - 731 - rlen = drm_dp_dpcd_readb(link->aux, DP_SINK_COUNT, 732 - &link->dp_link.sink_count); 733 - if (rlen < 0) { 734 - DRM_ERROR("sink count read failed. rlen=%zd\n", rlen); 735 - return rlen; 736 - } 737 - 738 - cp_ready = link->dp_link.sink_count & DP_SINK_CP_READY; 739 - 740 - link->dp_link.sink_count = 741 - DP_GET_SINK_COUNT(link->dp_link.sink_count); 742 - 743 - drm_dbg_dp(link->drm_dev, "sink_count = 0x%x, cp_ready = 0x%x\n", 744 - link->dp_link.sink_count, cp_ready); 745 - return 0; 746 - } 747 - 748 715 static int dp_link_parse_sink_status_field(struct dp_link_private *link) 749 716 { 750 - int len = 0; 717 + int len; 751 718 752 719 link->prev_sink_count = link->dp_link.sink_count; 753 - len = dp_link_parse_sink_count(&link->dp_link); 720 + len = drm_dp_read_sink_count(link->aux); 754 721 if (len < 0) { 755 722 DRM_ERROR("DP parse sink count failed\n"); 756 723 return len; 757 724 } 725 + link->dp_link.sink_count = len; 758 726 759 727 len = drm_dp_dpcd_read_link_status(link->aux, 760 728 link->link_status);