ASoC: msm8916-wcd-analog: Fix error handling in pm8916_wcd_analog_spmi_probe
[ Upstream commit 9ebd62d60edcd4d9c75485e5ccd0b79581ad3c49 ] 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: de66b3455023 ("ASoC: codecs: msm8916-wcd-analog: add MBHC support") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Link: https://lore.kernel.org/r/20220316041924.17560-1-linmq006@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
1f31073b77
commit
f419751373
@ -1195,8 +1195,10 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
irq = platform_get_irq_byname(pdev, "mbhc_switch_int");
|
||||
if (irq < 0)
|
||||
return irq;
|
||||
if (irq < 0) {
|
||||
ret = irq;
|
||||
goto err_disable_clk;
|
||||
}
|
||||
|
||||
ret = devm_request_threaded_irq(dev, irq, NULL,
|
||||
pm8916_mbhc_switch_irq_handler,
|
||||
@ -1208,8 +1210,10 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev)
|
||||
|
||||
if (priv->mbhc_btn_enabled) {
|
||||
irq = platform_get_irq_byname(pdev, "mbhc_but_press_det");
|
||||
if (irq < 0)
|
||||
return irq;
|
||||
if (irq < 0) {
|
||||
ret = irq;
|
||||
goto err_disable_clk;
|
||||
}
|
||||
|
||||
ret = devm_request_threaded_irq(dev, irq, NULL,
|
||||
mbhc_btn_press_irq_handler,
|
||||
@ -1220,8 +1224,10 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev)
|
||||
dev_err(dev, "cannot request mbhc button press irq\n");
|
||||
|
||||
irq = platform_get_irq_byname(pdev, "mbhc_but_rel_det");
|
||||
if (irq < 0)
|
||||
return irq;
|
||||
if (irq < 0) {
|
||||
ret = irq;
|
||||
goto err_disable_clk;
|
||||
}
|
||||
|
||||
ret = devm_request_threaded_irq(dev, irq, NULL,
|
||||
mbhc_btn_release_irq_handler,
|
||||
@ -1238,6 +1244,10 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev)
|
||||
return devm_snd_soc_register_component(dev, &pm8916_wcd_analog,
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user