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: de66b34550
("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:

committed by
Greg Kroah-Hartman

parent
90ac679aa6
commit
abefbf602c
@@ -1221,8 +1221,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,
|
||||
@@ -1234,8 +1236,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,
|
||||
@@ -1246,8 +1250,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,
|
||||
@@ -1264,6 +1270,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)
|
||||
|
Reference in New Issue
Block a user