Skip to content

Commit

Permalink
drm/msm/dp: replace variable err with len at dp_aux_link_power_up()
Browse files Browse the repository at this point in the history
drm_dp_dpcd_readb() will return 1 to indicate one byte had been read
successfully. This patch replace variable "err" with "len" have more
correct meaning.

changes in v5:
-- split into 3 patches

Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/502533/
Link: https://lore.kernel.org/r/1662999830-13916-3-git-send-email-quic_khsieh@quicinc.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
  • Loading branch information
Kuogee Hsieh authored and Dmitry Baryshkov committed Nov 2, 2022
1 parent 9a5c158 commit d54c518
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions drivers/gpu/drm/msm/dp/dp_link.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,21 @@ static int dp_aux_link_power_up(struct drm_dp_aux *aux,
struct dp_link_info *link)
{
u8 value;
int err;
ssize_t len;

if (link->revision < 0x11)
return 0;

err = drm_dp_dpcd_readb(aux, DP_SET_POWER, &value);
if (err < 0)
return err;
len = drm_dp_dpcd_readb(aux, DP_SET_POWER, &value);
if (len < 0)
return len;

value &= ~DP_SET_POWER_MASK;
value |= DP_SET_POWER_D0;

err = drm_dp_dpcd_writeb(aux, DP_SET_POWER, value);
if (err < 0)
return err;
len = drm_dp_dpcd_writeb(aux, DP_SET_POWER, value);
if (len < 0)
return len;

usleep_range(1000, 2000);

Expand Down

0 comments on commit d54c518

Please sign in to comment.