Skip to content

Commit

Permalink
ASoC: codecs: wcd938x: fix runtime PM imbalance on remove
Browse files Browse the repository at this point in the history
Make sure to balance the runtime PM operations, including the disable
count, on driver unbind.

Fixes: 1657252 ("ASoC: codecs: wcd938x-sdw: add SoundWire driver")
Cc: stable@vger.kernel.org      # 5.14
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20231003155558.27079-6-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Johan Hovold authored and Mark Brown committed Oct 9, 2023
1 parent 69a026a commit 3ebebb2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions sound/soc/codecs/wcd938x.c
Original file line number Diff line number Diff line change
Expand Up @@ -3620,9 +3620,15 @@ static int wcd938x_probe(struct platform_device *pdev)

static void wcd938x_remove(struct platform_device *pdev)
{
struct wcd938x_priv *wcd938x = dev_get_drvdata(&pdev->dev);
struct device *dev = &pdev->dev;
struct wcd938x_priv *wcd938x = dev_get_drvdata(dev);

component_master_del(dev, &wcd938x_comp_ops);

pm_runtime_disable(dev);
pm_runtime_set_suspended(dev);
pm_runtime_dont_use_autosuspend(dev);

component_master_del(&pdev->dev, &wcd938x_comp_ops);
regulator_bulk_disable(WCD938X_MAX_SUPPLY, wcd938x->supplies);
regulator_bulk_free(WCD938X_MAX_SUPPLY, wcd938x->supplies);
}
Expand Down

0 comments on commit 3ebebb2

Please sign in to comment.