Skip to content

Commit 3ebebb2

Browse files
jhovoldbroonie
authored andcommitted
ASoC: codecs: wcd938x: fix runtime PM imbalance on remove
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: [email protected] # 5.14 Cc: Srinivas Kandagatla <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 69a026a commit 3ebebb2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

sound/soc/codecs/wcd938x.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3620,9 +3620,15 @@ static int wcd938x_probe(struct platform_device *pdev)
36203620

36213621
static void wcd938x_remove(struct platform_device *pdev)
36223622
{
3623-
struct wcd938x_priv *wcd938x = dev_get_drvdata(&pdev->dev);
3623+
struct device *dev = &pdev->dev;
3624+
struct wcd938x_priv *wcd938x = dev_get_drvdata(dev);
3625+
3626+
component_master_del(dev, &wcd938x_comp_ops);
3627+
3628+
pm_runtime_disable(dev);
3629+
pm_runtime_set_suspended(dev);
3630+
pm_runtime_dont_use_autosuspend(dev);
36243631

3625-
component_master_del(&pdev->dev, &wcd938x_comp_ops);
36263632
regulator_bulk_disable(WCD938X_MAX_SUPPLY, wcd938x->supplies);
36273633
regulator_bulk_free(WCD938X_MAX_SUPPLY, wcd938x->supplies);
36283634
}

0 commit comments

Comments
 (0)