mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-03-08 02:25:21 +07:00
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: Tong Zhang <ztong0001@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
d012a7190f
commit
ed9ab229fe
@ -4409,9 +4409,9 @@ bool dc_link_get_backlight_level_nits(struct dc_link *link,
|
||||
link->connector_signal != SIGNAL_TYPE_DISPLAY_PORT))
|
||||
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,
|
||||
sizeof(union dpcd_source_backlight_get)))
|
||||
sizeof(union dpcd_source_backlight_get)) != DC_OK)
|
||||
return false;
|
||||
|
||||
*backlight_millinits_avg =
|
||||
@ -4450,9 +4450,9 @@ bool dc_link_read_default_bl_aux(struct dc_link *link, uint32_t *backlight_milli
|
||||
link->connector_signal != SIGNAL_TYPE_DISPLAY_PORT))
|
||||
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,
|
||||
sizeof(uint32_t)))
|
||||
sizeof(uint32_t)) != DC_OK)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user