mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
ASoC: codecs: wcd938x-sdw: fix runtime PM imbalance on probe errors
commitc5c0383082upstream. Make sure to balance the runtime PM operations, including the disable count, on probe errors and on driver unbind. Fixes:16572522ae("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-8-johan+linaro@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
0d912daab4
commit
569afdedde
@@ -1278,7 +1278,18 @@ static int wcd9380_probe(struct sdw_slave *pdev,
|
|||||||
pm_runtime_set_active(dev);
|
pm_runtime_set_active(dev);
|
||||||
pm_runtime_enable(dev);
|
pm_runtime_enable(dev);
|
||||||
|
|
||||||
return component_add(dev, &wcd938x_sdw_component_ops);
|
ret = component_add(dev, &wcd938x_sdw_component_ops);
|
||||||
|
if (ret)
|
||||||
|
goto err_disable_rpm;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
err_disable_rpm:
|
||||||
|
pm_runtime_disable(dev);
|
||||||
|
pm_runtime_set_suspended(dev);
|
||||||
|
pm_runtime_dont_use_autosuspend(dev);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int wcd9380_remove(struct sdw_slave *pdev)
|
static int wcd9380_remove(struct sdw_slave *pdev)
|
||||||
@@ -1287,6 +1298,10 @@ static int wcd9380_remove(struct sdw_slave *pdev)
|
|||||||
|
|
||||||
component_del(dev, &wcd938x_sdw_component_ops);
|
component_del(dev, &wcd938x_sdw_component_ops);
|
||||||
|
|
||||||
|
pm_runtime_disable(dev);
|
||||||
|
pm_runtime_set_suspended(dev);
|
||||||
|
pm_runtime_dont_use_autosuspend(dev);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user