From e41138f310221af1f1c243629438c25f547e321b Mon Sep 17 00:00:00 2001 From: Shiv Maliyappanahalli Date: Wed, 17 Aug 2016 15:33:31 -0700 Subject: [PATCH] ASoC: codecs: fix edid error when hdmi ops is null When edid mixer control is executed, if the hdmi ops is not set, the mixer control get_info() returns error. This error is treated as fatal by the caller. Fix by returning valid mixer control info when hdmi ops is null. Change-Id: I0097a75d94690b199fab1adc7f2ff3faa2d82e7b Signed-off-by: Shiv Maliyappanahalli --- sound/soc/codecs/msm_hdmi_codec_rx.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/msm_hdmi_codec_rx.c b/sound/soc/codecs/msm_hdmi_codec_rx.c index 002476d7a923..241410c60b97 100755 --- a/sound/soc/codecs/msm_hdmi_codec_rx.c +++ b/sound/soc/codecs/msm_hdmi_codec_rx.c @@ -38,8 +38,12 @@ static int msm_hdmi_edid_ctl_info(struct snd_kcontrol *kcontrol, codec_data = snd_soc_codec_get_drvdata(codec); - if (!codec_data->hdmi_ops.get_audio_edid_blk) - return -EINVAL; + if (!codec_data->hdmi_ops.get_audio_edid_blk) { + pr_debug("%s: get_audio_edid_blk() is NULL\n", __func__); + uinfo->type = SNDRV_CTL_ELEM_TYPE_BYTES; + uinfo->count = 0; + return 0; + } rc = codec_data->hdmi_ops.get_audio_edid_blk( codec_data->hdmi_core_pdev,