Commit 9ebd62d6 authored by Miaoqian Lin's avatar Miaoqian Lin Committed by Mark Brown

ASoC: msm8916-wcd-analog: Fix error handling in pm8916_wcd_analog_spmi_probe

In the error handling path, the clk_prepare_enable() function
call should be balanced by a corresponding 'clk_disable_unprepare()'
call , as already done in the remove function.

Fixes: de66b345 ("ASoC: codecs: msm8916-wcd-analog: add MBHC support")
Signed-off-by: default avatarMiaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220316041924.17560-1-linmq006@gmail.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent e8ca4cee
...@@ -1222,8 +1222,10 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev) ...@@ -1222,8 +1222,10 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev)
} }
irq = platform_get_irq_byname(pdev, "mbhc_switch_int"); irq = platform_get_irq_byname(pdev, "mbhc_switch_int");
if (irq < 0) if (irq < 0) {
return irq; ret = irq;
goto err_disable_clk;
}
ret = devm_request_threaded_irq(dev, irq, NULL, ret = devm_request_threaded_irq(dev, irq, NULL,
pm8916_mbhc_switch_irq_handler, pm8916_mbhc_switch_irq_handler,
...@@ -1235,8 +1237,10 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev) ...@@ -1235,8 +1237,10 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev)
if (priv->mbhc_btn_enabled) { if (priv->mbhc_btn_enabled) {
irq = platform_get_irq_byname(pdev, "mbhc_but_press_det"); irq = platform_get_irq_byname(pdev, "mbhc_but_press_det");
if (irq < 0) if (irq < 0) {
return irq; ret = irq;
goto err_disable_clk;
}
ret = devm_request_threaded_irq(dev, irq, NULL, ret = devm_request_threaded_irq(dev, irq, NULL,
mbhc_btn_press_irq_handler, mbhc_btn_press_irq_handler,
...@@ -1247,8 +1251,10 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev) ...@@ -1247,8 +1251,10 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev)
dev_err(dev, "cannot request mbhc button press irq\n"); dev_err(dev, "cannot request mbhc button press irq\n");
irq = platform_get_irq_byname(pdev, "mbhc_but_rel_det"); irq = platform_get_irq_byname(pdev, "mbhc_but_rel_det");
if (irq < 0) if (irq < 0) {
return irq; ret = irq;
goto err_disable_clk;
}
ret = devm_request_threaded_irq(dev, irq, NULL, ret = devm_request_threaded_irq(dev, irq, NULL,
mbhc_btn_release_irq_handler, mbhc_btn_release_irq_handler,
...@@ -1265,6 +1271,10 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev) ...@@ -1265,6 +1271,10 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev)
return devm_snd_soc_register_component(dev, &pm8916_wcd_analog, return devm_snd_soc_register_component(dev, &pm8916_wcd_analog,
pm8916_wcd_analog_dai, pm8916_wcd_analog_dai,
ARRAY_SIZE(pm8916_wcd_analog_dai)); ARRAY_SIZE(pm8916_wcd_analog_dai));
err_disable_clk:
clk_disable_unprepare(priv->mclk);
return ret;
} }
static int pm8916_wcd_analog_spmi_remove(struct platform_device *pdev) static int pm8916_wcd_analog_spmi_remove(struct platform_device *pdev)
......
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