lkml.org 
[lkml]   [2023]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5/7] ASoC: codecs: wcd938x: fix runtime PM imbalance on remove
    Date
    Make sure to balance the runtime PM operations, including the disable
    count, on driver unbind.

    Fixes: 16572522aece ("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>
    ---
    sound/soc/codecs/wcd938x.c | 10 ++++++++--
    1 file changed, 8 insertions(+), 2 deletions(-)

    diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c
    index 679c627f7eaa..d27b919c63b4 100644
    --- a/sound/soc/codecs/wcd938x.c
    +++ b/sound/soc/codecs/wcd938x.c
    @@ -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);
    }
    --
    2.41.0
    \
     
     \ /
      Last update: 2023-10-03 17:59    [W:3.098 / U:0.000 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site