未验证 提交 ddfd5345 编写于 作者: C Christophe JAILLET 提交者: Mark Brown

ASoC: codecs: Fix an error handling path in (rx|tx|va)_macro_probe()

After a successful lpass_macro_pds_init() call, lpass_macro_pds_exit() must
be called.

Add the missing call in the error handling path of the probe function and
use it.

Fixes: 9e3d83c5 ("ASoC: codecs: Add power domains support in digital macro codecs")
Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/5b5a015a9b1dc8011c6a4053fa49da1f2531e47c.1648969065.git.christophe.jaillet@wanadoo.frSigned-off-by: NMark Brown <broonie@kernel.org>
上级 aa70527d
...@@ -3566,12 +3566,16 @@ static int rx_macro_probe(struct platform_device *pdev) ...@@ -3566,12 +3566,16 @@ static int rx_macro_probe(struct platform_device *pdev)
return PTR_ERR(rx->pds); return PTR_ERR(rx->pds);
base = devm_platform_ioremap_resource(pdev, 0); base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(base)) if (IS_ERR(base)) {
return PTR_ERR(base); ret = PTR_ERR(base);
goto err;
}
rx->regmap = devm_regmap_init_mmio(dev, base, &rx_regmap_config); rx->regmap = devm_regmap_init_mmio(dev, base, &rx_regmap_config);
if (IS_ERR(rx->regmap)) if (IS_ERR(rx->regmap)) {
return PTR_ERR(rx->regmap); ret = PTR_ERR(rx->regmap);
goto err;
}
dev_set_drvdata(dev, rx); dev_set_drvdata(dev, rx);
...@@ -3632,6 +3636,8 @@ static int rx_macro_probe(struct platform_device *pdev) ...@@ -3632,6 +3636,8 @@ static int rx_macro_probe(struct platform_device *pdev)
err_dcodec: err_dcodec:
clk_disable_unprepare(rx->macro); clk_disable_unprepare(rx->macro);
err: err:
lpass_macro_pds_exit(rx->pds);
return ret; return ret;
} }
......
...@@ -1828,8 +1828,10 @@ static int tx_macro_probe(struct platform_device *pdev) ...@@ -1828,8 +1828,10 @@ static int tx_macro_probe(struct platform_device *pdev)
return PTR_ERR(tx->pds); return PTR_ERR(tx->pds);
base = devm_platform_ioremap_resource(pdev, 0); base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(base)) if (IS_ERR(base)) {
return PTR_ERR(base); ret = PTR_ERR(base);
goto err;
}
/* Update defaults for lpass sc7280 */ /* Update defaults for lpass sc7280 */
if (of_device_is_compatible(np, "qcom,sc7280-lpass-tx-macro")) { if (of_device_is_compatible(np, "qcom,sc7280-lpass-tx-macro")) {
...@@ -1846,8 +1848,10 @@ static int tx_macro_probe(struct platform_device *pdev) ...@@ -1846,8 +1848,10 @@ static int tx_macro_probe(struct platform_device *pdev)
} }
tx->regmap = devm_regmap_init_mmio(dev, base, &tx_regmap_config); tx->regmap = devm_regmap_init_mmio(dev, base, &tx_regmap_config);
if (IS_ERR(tx->regmap)) if (IS_ERR(tx->regmap)) {
return PTR_ERR(tx->regmap); ret = PTR_ERR(tx->regmap);
goto err;
}
dev_set_drvdata(dev, tx); dev_set_drvdata(dev, tx);
...@@ -1907,6 +1911,8 @@ static int tx_macro_probe(struct platform_device *pdev) ...@@ -1907,6 +1911,8 @@ static int tx_macro_probe(struct platform_device *pdev)
err_dcodec: err_dcodec:
clk_disable_unprepare(tx->macro); clk_disable_unprepare(tx->macro);
err: err:
lpass_macro_pds_exit(tx->pds);
return ret; return ret;
} }
......
...@@ -1434,8 +1434,10 @@ static int va_macro_probe(struct platform_device *pdev) ...@@ -1434,8 +1434,10 @@ static int va_macro_probe(struct platform_device *pdev)
va->dmic_clk_div = VA_MACRO_CLK_DIV_2; va->dmic_clk_div = VA_MACRO_CLK_DIV_2;
} else { } else {
ret = va_macro_validate_dmic_sample_rate(sample_rate, va); ret = va_macro_validate_dmic_sample_rate(sample_rate, va);
if (!ret) if (!ret) {
return -EINVAL; ret = -EINVAL;
goto err;
}
} }
base = devm_platform_ioremap_resource(pdev, 0); base = devm_platform_ioremap_resource(pdev, 0);
...@@ -1492,6 +1494,8 @@ static int va_macro_probe(struct platform_device *pdev) ...@@ -1492,6 +1494,8 @@ static int va_macro_probe(struct platform_device *pdev)
err_dcodec: err_dcodec:
clk_disable_unprepare(va->macro); clk_disable_unprepare(va->macro);
err: err:
lpass_macro_pds_exit(va->pds);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册