Commit bebf0051 authored by Tomi Valkeinen's avatar Tomi Valkeinen

drm/omap: hdmi4: fix use of uninitialized var

If use_mclk is false, mclk_mode is written to a register without
initialization. This doesn't cause any ill effects as the written value
is not used when use_mclk is false.

To fix this, write use_mclk only when use_mclk is true.
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190930103840.18970-8-tomi.valkeinen@ti.comReviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
parent 9c5fa79f
......@@ -542,8 +542,9 @@ static void hdmi_core_audio_config(struct hdmi_core_data *core,
}
/* Set ACR clock divisor */
REG_FLD_MOD(av_base,
HDMI_CORE_AV_FREQ_SVAL, cfg->mclk_mode, 2, 0);
if (cfg->use_mclk)
REG_FLD_MOD(av_base, HDMI_CORE_AV_FREQ_SVAL,
cfg->mclk_mode, 2, 0);
r = hdmi_read_reg(av_base, HDMI_CORE_AV_ACR_CTRL);
/*
......
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