Commit 8d7313bf authored by Christophe Jaillet's avatar Christophe Jaillet Committed by Mark Brown

ASoC: mediatek: Fix an error checking code

Check the value returned by 'devm_clk_get()' instead of the clock
identifier which can never be an ERR code.

Fixes: d6f3710a ("ASoC: mediatek: add structure define and clock control for 2701")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 5771a8c0
......@@ -75,7 +75,7 @@ int mt2701_init_clock(struct mtk_base_afe *afe)
for (i = 0; i < MT2701_CLOCK_NUM; i++) {
afe_priv->clocks[i] = devm_clk_get(afe->dev, aud_clks[i]);
if (IS_ERR(aud_clks[i])) {
if (IS_ERR(afe_priv->clocks[i])) {
dev_warn(afe->dev, "%s devm_clk_get %s fail\n",
__func__, aud_clks[i]);
return PTR_ERR(aud_clks[i]);
......
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