[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210408064036.6691-1-dinghao.liu@zju.edu.cn>
Date: Thu, 8 Apr 2021 14:40:34 +0800
From: Dinghao Liu <dinghao.liu@....edu.cn>
To: dinghao.liu@....edu.cn, kjlu@....edu
Cc: Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>,
"Gustavo A. R. Silva" <gustavoars@...nel.org>,
Peter Ujfalusi <peter.ujfalusi@...com>,
"Alexander A. Klimov" <grandmaster@...klimov.de>,
alsa-devel@...a-project.org, linux-kernel@...r.kernel.org
Subject: [PATCH] [v2] ASoC: codecs: Fix runtime PM imbalance in tas2552_probe
There is a rumtime PM imbalance between the error handling path
after devm_snd_soc_register_component() and all other error
handling paths. Add a PM runtime increment to balance refcount.
Signed-off-by: Dinghao Liu <dinghao.liu@....edu.cn>
---
Changelog:
v2: - Add a PM runtime increment to fix it instead of moving
the PM related operations after the registration.
---
sound/soc/codecs/tas2552.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sound/soc/codecs/tas2552.c b/sound/soc/codecs/tas2552.c
index bd00c35116cd..700baa6314aa 100644
--- a/sound/soc/codecs/tas2552.c
+++ b/sound/soc/codecs/tas2552.c
@@ -730,8 +730,10 @@ static int tas2552_probe(struct i2c_client *client,
ret = devm_snd_soc_register_component(&client->dev,
&soc_component_dev_tas2552,
tas2552_dai, ARRAY_SIZE(tas2552_dai));
- if (ret < 0)
+ if (ret < 0) {
dev_err(&client->dev, "Failed to register component: %d\n", ret);
+ pm_runtime_get_noresume(&client->dev);
+ }
return ret;
}
--
2.17.1
Powered by blists - more mailing lists