We need a default case to handle the additional enum values. While here drop the need for a local variable. Fixes: 808a662bb3a8 ("drm/amd/display: Add DP 2.0 SST DC Support") Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx> --- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c index fc122c8c2318..0126e71841fa 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c @@ -257,20 +257,15 @@ static void dpcd_set_training_pattern( static enum dc_dp_training_pattern decide_cr_training_pattern( const struct dc_link_settings *link_settings) { - enum dc_dp_training_pattern pattern = DP_TRAINING_PATTERN_SEQUENCE_1; - switch (dp_get_link_encoding_format(link_settings)) { case DP_8b_10b_ENCODING: - pattern = DP_TRAINING_PATTERN_SEQUENCE_1; - break; + default: + return DP_TRAINING_PATTERN_SEQUENCE_1; #if defined(CONFIG_DRM_AMD_DC_DCN) case DP_128b_132b_ENCODING: - pattern = DP_128b_132b_TPS1; - break; + return DP_128b_132b_TPS1; #endif } - - return pattern; } static enum dc_dp_training_pattern decide_eq_training_pattern(struct dc_link *link, -- 2.31.1