Skip to contentSkip to conversation

ALSA: ac97: fix check of pm_runtime_get_sync failure

PATCH Applied [email protected] 2 participants 4 messages Aug 15, 2018 – Aug 19, 2018 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ALSA: ac97: fix check of pm_runtime_get_sync failure

From: Lihua Yao <[email protected]>

pm_runtime_get_sync returns negative on failure.

Fixes 74426fbff66e ("ALSA: ac97: add an ac97 bus")
---
 sound/ac97/bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/ac97/bus.c +1 -1
index 31f858eceffc..c267e44fefa0 100644
@@ -503,7 +503,7 @@ static int ac97_bus_remove(struct device *dev)
 	int ret;
 
 	ret = pm_runtime_get_sync(dev);
-	if (ret)
+	if (ret < 0)
 		return ret;
 
 	ret = adrv->remove(adev);
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/2 ALSA: ac97: fix unbalanced pm_runtime_enable

From: Lihua Yao <[email protected]>

Runtime PM is enabled at ac97_bus_probe() and should be disabled at ac97_bus_remove().

Fixes 74426fbff66e ("ALSA: ac97: add an ac97 bus")
---
 sound/ac97/bus.c | 2 ++
 1 file changed, 2 insertions(+)
sound/ac97/bus.c +2 -0
index c267e44fefa0..83eed9d7f679 100644
@@ -511,6 +511,8 @@ static int ac97_bus_remove(struct device *dev)
 	if (ret == 0)
 		ac97_put_disable_clk(adev);
 
+	pm_runtime_disable(dev);
+
 	return ret;
 }
 
Signature · 1 line
2.17.1
Applied
#2 lore raw

Re: [PATCH 2/2] ALSA: ac97: fix unbalanced pm_runtime_enable

Quoted 8 lines · On Wed, 15 Aug 2018 17:20:35 +0200, [email protected] wrote:

From: Lihua Yao <[email protected]>

Runtime PM is enabled at ac97_bus_probe() and should be disabled at ac97_bus_remove().

Fixes 74426fbff66e ("ALSA: ac97: add an ac97 bus")

Applied, thanks.

Takashi