Commit 16697cf3 authored by Tong Zhang's avatar Tong Zhang Committed by Alex Deucher

drm/amd/display: should check error using DC_OK

core_link_read_dpcd returns only DC_OK(1) and DC_ERROR_UNEXPECTED(-1),
the caller should check error using DC_OK instead of checking against 0
Signed-off-by: default avatarTong Zhang <ztong0001@gmail.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 1d550333
...@@ -4413,9 +4413,9 @@ bool dc_link_get_backlight_level_nits(struct dc_link *link, ...@@ -4413,9 +4413,9 @@ bool dc_link_get_backlight_level_nits(struct dc_link *link,
link->connector_signal != SIGNAL_TYPE_DISPLAY_PORT)) link->connector_signal != SIGNAL_TYPE_DISPLAY_PORT))
return false; return false;
if (!core_link_read_dpcd(link, DP_SOURCE_BACKLIGHT_CURRENT_PEAK, if (core_link_read_dpcd(link, DP_SOURCE_BACKLIGHT_CURRENT_PEAK,
dpcd_backlight_get.raw, dpcd_backlight_get.raw,
sizeof(union dpcd_source_backlight_get))) sizeof(union dpcd_source_backlight_get)) != DC_OK)
return false; return false;
*backlight_millinits_avg = *backlight_millinits_avg =
...@@ -4454,9 +4454,9 @@ bool dc_link_read_default_bl_aux(struct dc_link *link, uint32_t *backlight_milli ...@@ -4454,9 +4454,9 @@ bool dc_link_read_default_bl_aux(struct dc_link *link, uint32_t *backlight_milli
link->connector_signal != SIGNAL_TYPE_DISPLAY_PORT)) link->connector_signal != SIGNAL_TYPE_DISPLAY_PORT))
return false; return false;
if (!core_link_read_dpcd(link, DP_SOURCE_BACKLIGHT_LEVEL, if (core_link_read_dpcd(link, DP_SOURCE_BACKLIGHT_LEVEL,
(uint8_t *) backlight_millinits, (uint8_t *) backlight_millinits,
sizeof(uint32_t))) sizeof(uint32_t)) != DC_OK)
return false; return false;
return true; return true;
......
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