* [PATCH] ASoC: Codec: wm8962: balance pm_runtime_enable
@ 2015-09-30 4:54 Jiada Wang
2015-09-30 7:48 ` Charles Keepax
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Jiada Wang @ 2015-09-30 4:54 UTC (permalink / raw)
To: lgirdwood, broonie, perex, tiwai, patches, alsa-devel,
linux-kernel
pm_runtime_enable is called in probe to enable runtime PM
for wm8962 codec, but pm_runtime_disable isn't called in remove
callback, nor is called in error path if probe fails after runtime
PM is enabled, this causes unbalanced pm_runtime_enable.
This patch Adds pm_runtime_disable in remove callback and error path,
to balance pm_runtime_enable.
Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
---
sound/soc/codecs/wm8962.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index 293e47a..2fbc6ef 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -3760,7 +3760,7 @@ static int wm8962_i2c_probe(struct i2c_client *i2c,
ret = snd_soc_register_codec(&i2c->dev,
&soc_codec_dev_wm8962, &wm8962_dai, 1);
if (ret < 0)
- goto err_enable;
+ goto err_pm_runtime;
regcache_cache_only(wm8962->regmap, true);
@@ -3769,6 +3769,8 @@ static int wm8962_i2c_probe(struct i2c_client *i2c,
return 0;
+err_pm_runtime:
+ pm_runtime_disable(&i2c->dev);
err_enable:
regulator_bulk_disable(ARRAY_SIZE(wm8962->supplies), wm8962->supplies);
err:
@@ -3778,6 +3780,7 @@ err:
static int wm8962_i2c_remove(struct i2c_client *client)
{
snd_soc_unregister_codec(&client->dev);
+ pm_runtime_disable(&client->dev);
return 0;
}
--
2.4.5
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] ASoC: Codec: wm8962: balance pm_runtime_enable
2015-09-30 4:54 [PATCH] ASoC: Codec: wm8962: balance pm_runtime_enable Jiada Wang
@ 2015-09-30 7:48 ` Charles Keepax
2015-09-30 18:11 ` Mark Brown
2015-09-30 19:32 ` Applied "ASoC: wm8962: balance pm_runtime_enable" to the asoc tree Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Charles Keepax @ 2015-09-30 7:48 UTC (permalink / raw)
To: Jiada Wang; +Cc: alsa-devel, linux-kernel, patches, tiwai, lgirdwood, broonie
On Wed, Sep 30, 2015 at 01:54:13PM +0900, Jiada Wang wrote:
> pm_runtime_enable is called in probe to enable runtime PM
> for wm8962 codec, but pm_runtime_disable isn't called in remove
> callback, nor is called in error path if probe fails after runtime
> PM is enabled, this causes unbalanced pm_runtime_enable.
>
> This patch Adds pm_runtime_disable in remove callback and error path,
> to balance pm_runtime_enable.
>
> Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
> ---
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Thanks,
Charles
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ASoC: Codec: wm8962: balance pm_runtime_enable
2015-09-30 4:54 [PATCH] ASoC: Codec: wm8962: balance pm_runtime_enable Jiada Wang
2015-09-30 7:48 ` Charles Keepax
@ 2015-09-30 18:11 ` Mark Brown
2015-09-30 19:32 ` Applied "ASoC: wm8962: balance pm_runtime_enable" to the asoc tree Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2015-09-30 18:11 UTC (permalink / raw)
To: Jiada Wang; +Cc: lgirdwood, perex, tiwai, patches, alsa-devel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 398 bytes --]
On Wed, Sep 30, 2015 at 01:54:13PM +0900, Jiada Wang wrote:
> pm_runtime_enable is called in probe to enable runtime PM
> for wm8962 codec, but pm_runtime_disable isn't called in remove
> callback, nor is called in error path if probe fails after runtime
> PM is enabled, this causes unbalanced pm_runtime_enable.
Applied, but please use subject lines matching the normal style for the
subsystem.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Applied "ASoC: wm8962: balance pm_runtime_enable" to the asoc tree
2015-09-30 4:54 [PATCH] ASoC: Codec: wm8962: balance pm_runtime_enable Jiada Wang
2015-09-30 7:48 ` Charles Keepax
2015-09-30 18:11 ` Mark Brown
@ 2015-09-30 19:32 ` Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2015-09-30 19:32 UTC (permalink / raw)
To: Jiada Wang, Charles Keepax, Mark Brown; +Cc: alsa-devel
The patch
ASoC: wm8962: balance pm_runtime_enable
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
>From 57622aef86d21d459e937c72f578050ff4a91af5 Mon Sep 17 00:00:00 2001
From: Jiada Wang <jiada_wang@mentor.com>
Date: Wed, 30 Sep 2015 13:54:13 +0900
Subject: [PATCH] ASoC: wm8962: balance pm_runtime_enable
pm_runtime_enable is called in probe to enable runtime PM
for wm8962 codec, but pm_runtime_disable isn't called in remove
callback, nor is called in error path if probe fails after runtime
PM is enabled, this causes unbalanced pm_runtime_enable.
This patch Adds pm_runtime_disable in remove callback and error path,
to balance pm_runtime_enable.
Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
sound/soc/codecs/wm8962.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index b4eb975..85a2c54 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -3759,7 +3759,7 @@ static int wm8962_i2c_probe(struct i2c_client *i2c,
ret = snd_soc_register_codec(&i2c->dev,
&soc_codec_dev_wm8962, &wm8962_dai, 1);
if (ret < 0)
- goto err_enable;
+ goto err_pm_runtime;
regcache_cache_only(wm8962->regmap, true);
@@ -3768,6 +3768,8 @@ static int wm8962_i2c_probe(struct i2c_client *i2c,
return 0;
+err_pm_runtime:
+ pm_runtime_disable(&i2c->dev);
err_enable:
regulator_bulk_disable(ARRAY_SIZE(wm8962->supplies), wm8962->supplies);
err:
@@ -3777,6 +3779,7 @@ err:
static int wm8962_i2c_remove(struct i2c_client *client)
{
snd_soc_unregister_codec(&client->dev);
+ pm_runtime_disable(&client->dev);
return 0;
}
--
2.5.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-09-30 19:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-30 4:54 [PATCH] ASoC: Codec: wm8962: balance pm_runtime_enable Jiada Wang
2015-09-30 7:48 ` Charles Keepax
2015-09-30 18:11 ` Mark Brown
2015-09-30 19:32 ` Applied "ASoC: wm8962: balance pm_runtime_enable" to the asoc tree Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox