提交 57f174f4 编写于 作者: B Bard Liao 提交者: Mark Brown

ASoC: rt5640: add default case for unexpected ID

We may read an unexpected value when detemining which codec is attached.
In that case, either a unsupported codec is attached or something wrong
with I2C. The driver will not work properly on both cases. So we return
an error for that.
Signed-off-by: NBard Liao <bardliao@realtek.com>
Reviewed-by: NStephen Warren <swarren@nvidia.com>
Signed-off-by: NMark Brown <broonie@linaro.org>
上级 4eefa0d8
......@@ -2018,6 +2018,10 @@ static int rt5640_probe(struct snd_soc_codec *codec)
rt5639_specific_dapm_routes,
ARRAY_SIZE(rt5639_specific_dapm_routes));
break;
default:
dev_err(codec->dev,
"The driver is for RT5639 RT5640 or RT5642 only\n");
return -ENODEV;
}
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册