Fix PM disable depth imbalance in probe

Merge series from Zhang Qilong <zhangqilong3@huawei.com>:

The pm_runtime_enable will increase power disable depth. Thus
a pairing decrement is needed on the error handling path to
keep it balanced according to context. We fix it by moving
pm_runtime_enable to the endding of probe.

Zhang Qilong (4):
  ASoC: wm8997: Fix PM disable depth imbalance in wm8997_probe
  ASoC: wm5110: Fix PM disable depth imbalance in wm5110_probe
  ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe
  ASoC: mt6660: Fix PM disable depth imbalance in mt6660_i2c_probe

 sound/soc/codecs/mt6660.c | 8 ++++++--
 sound/soc/codecs/wm5102.c | 6 +++---
 sound/soc/codecs/wm5110.c | 6 +++---
 sound/soc/codecs/wm8997.c | 6 +++---
 4 files changed, 15 insertions(+), 11 deletions(-)

--
2.25.1
This commit is contained in:
Mark Brown 2022-09-30 09:15:58 +01:00
commit d488b28502
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
4 changed files with 15 additions and 11 deletions

View File

@ -503,13 +503,17 @@ static int mt6660_i2c_probe(struct i2c_client *client)
dev_err(chip->dev, "read chip revision fail\n");
goto probe_fail;
}
pm_runtime_set_active(chip->dev);
pm_runtime_enable(chip->dev);
ret = devm_snd_soc_register_component(chip->dev,
&mt6660_component_driver,
&mt6660_codec_dai, 1);
if (!ret) {
pm_runtime_set_active(chip->dev);
pm_runtime_enable(chip->dev);
}
return ret;
probe_fail:
_mt6660_chip_power_on(chip, 0);
mutex_destroy(&chip->io_lock);

View File

@ -2099,9 +2099,6 @@ static int wm5102_probe(struct platform_device *pdev)
regmap_update_bits(arizona->regmap, wm5102_digital_vu[i],
WM5102_DIG_VU, WM5102_DIG_VU);
pm_runtime_enable(&pdev->dev);
pm_runtime_idle(&pdev->dev);
ret = arizona_request_irq(arizona, ARIZONA_IRQ_DSP_IRQ1,
"ADSP2 Compressed IRQ", wm5102_adsp2_irq,
wm5102);
@ -2134,6 +2131,9 @@ static int wm5102_probe(struct platform_device *pdev)
goto err_spk_irqs;
}
pm_runtime_enable(&pdev->dev);
pm_runtime_idle(&pdev->dev);
return ret;
err_spk_irqs:

View File

@ -2457,9 +2457,6 @@ static int wm5110_probe(struct platform_device *pdev)
regmap_update_bits(arizona->regmap, wm5110_digital_vu[i],
WM5110_DIG_VU, WM5110_DIG_VU);
pm_runtime_enable(&pdev->dev);
pm_runtime_idle(&pdev->dev);
ret = arizona_request_irq(arizona, ARIZONA_IRQ_DSP_IRQ1,
"ADSP2 Compressed IRQ", wm5110_adsp2_irq,
wm5110);
@ -2492,6 +2489,9 @@ static int wm5110_probe(struct platform_device *pdev)
goto err_spk_irqs;
}
pm_runtime_enable(&pdev->dev);
pm_runtime_idle(&pdev->dev);
return ret;
err_spk_irqs:

View File

@ -1161,9 +1161,6 @@ static int wm8997_probe(struct platform_device *pdev)
regmap_update_bits(arizona->regmap, wm8997_digital_vu[i],
WM8997_DIG_VU, WM8997_DIG_VU);
pm_runtime_enable(&pdev->dev);
pm_runtime_idle(&pdev->dev);
arizona_init_common(arizona);
ret = arizona_init_vol_limit(arizona);
@ -1182,6 +1179,9 @@ static int wm8997_probe(struct platform_device *pdev)
goto err_spk_irqs;
}
pm_runtime_enable(&pdev->dev);
pm_runtime_idle(&pdev->dev);
return ret;
err_spk_irqs: