From acdae4632e40f05e0f0731c5a383e461324aea65 Mon Sep 17 00:00:00 2001 From: Shuming Fan Date: Thu, 16 Mar 2023 09:30:41 +0800 Subject: soundwire: stream: restore cumulative bus bandwidth when compute_params callback failed The _sdw_prepare_stream function just returns the error code when compute_params callback failed. The cumulative bus bandwidth will keep the value and won't be decreased by sdw_deprepare_stream function. We should restore the value of cumulative bus bandwidth when compute_params callback failed. Signed-off-by: Shuming Fan Reviewed-by: Paul Olaru Reviewed-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230316013041.1008003-1-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul --- drivers/soundwire/stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/soundwire') diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c index 8c6da1739e3d..136b6850a3f0 100644 --- a/drivers/soundwire/stream.c +++ b/drivers/soundwire/stream.c @@ -1369,7 +1369,7 @@ static int _sdw_prepare_stream(struct sdw_stream_runtime *stream, if (ret < 0) { dev_err(bus->dev, "Compute params failed: %d\n", ret); - return ret; + goto restore_params; } } -- cgit v1.2.3