diff options
author | Takashi Iwai <tiwai@suse.de> | 2016-11-21 17:30:23 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2016-11-21 17:30:23 +0100 |
commit | 4b0ae98622adce0a182a2540e16f087e96308453 (patch) | |
tree | 915576754f04bf08cb45fba0af46e23c3965e4a2 | |
parent | bc6fdcc9d1cba4232413d199720b6f48fe5be0d2 (diff) | |
download | hda-emu-4b0ae98622adce0a182a2540e16f087e96308453.tar.gz |
Fix the regression wrt runtime PM
The pm_runtime_get_if_in_use() should return -EINVAL when no runtime
PM is used. But we didn't check it, thus it resulted as if the codec
power were down.
Fix it by referring to the actual power_save value in
pm_runtime_get_if_in_use().
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | hda-emu.c | 7 | ||||
-rw-r--r-- | snd-wrapper.c | 2 |
2 files changed, 5 insertions, 4 deletions
@@ -212,15 +212,14 @@ int hda_get_power_save(void) void hda_set_power_save(int val) { -#ifdef NEW_HDA_INFRA - snd_hda_set_power_save(bus, val * 1000); -#else /* !NEW_HDA_INFRA */ #ifdef HDA_OLD_POWER_SAVE *power_save_parameter = val; #else power_save = val; +#ifdef NEW_HDA_INFRA + snd_hda_set_power_save(bus, val * 1000); #endif -#endif /* NEW_HDA_INFRA */ +#endif /* HDA_OLD_POWER_SAVE */ } /* diff --git a/snd-wrapper.c b/snd-wrapper.c index 6644742..2747bd0 100644 --- a/snd-wrapper.c +++ b/snd-wrapper.c @@ -852,6 +852,8 @@ int pm_runtime_get_sync(struct device *dev) int pm_runtime_get_if_in_use(struct device *dev) { + if (!hda_get_power_save()) + return -EINVAL; if (dev->pmcnt > 0) { dev->pmcnt++; return 1; |