diff options
author | Jaroslav Kysela <perex@perex.cz> | 2016-06-17 07:35:56 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2016-06-17 08:01:06 -0400 |
commit | 8198868f0a283eb23e264951632ce61ec2f82228 (patch) | |
tree | 174fda4a1f0f258019714112392a75326cb8599a | |
parent | 35639a0e98391036a4c7f23253c321d6621a8897 (diff) |
ALSA: hdac_regmap - fix the register access for runtime PM
Call path:
1) snd_hdac_power_up_pm()
2) snd_hdac_power_up()
3) pm_runtime_get_sync()
4) __pm_runtime_resume()
5) rpm_resume()
The rpm_resume() returns 1 when the device is already active.
Because the return value is unmodified, the hdac regmap read/write
functions should allow this value for the retry I/O operation, too.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/hda/hdac_regmap.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/hda/hdac_regmap.c b/sound/hda/hdac_regmap.c index 87041ddd29cb..47a358fab132 100644 --- a/sound/hda/hdac_regmap.c +++ b/sound/hda/hdac_regmap.c | |||
@@ -444,7 +444,7 @@ int snd_hdac_regmap_write_raw(struct hdac_device *codec, unsigned int reg, | |||
444 | err = reg_raw_write(codec, reg, val); | 444 | err = reg_raw_write(codec, reg, val); |
445 | if (err == -EAGAIN) { | 445 | if (err == -EAGAIN) { |
446 | err = snd_hdac_power_up_pm(codec); | 446 | err = snd_hdac_power_up_pm(codec); |
447 | if (!err) | 447 | if (err >= 0) |
448 | err = reg_raw_write(codec, reg, val); | 448 | err = reg_raw_write(codec, reg, val); |
449 | snd_hdac_power_down_pm(codec); | 449 | snd_hdac_power_down_pm(codec); |
450 | } | 450 | } |
@@ -470,7 +470,7 @@ static int __snd_hdac_regmap_read_raw(struct hdac_device *codec, | |||
470 | err = reg_raw_read(codec, reg, val, uncached); | 470 | err = reg_raw_read(codec, reg, val, uncached); |
471 | if (err == -EAGAIN) { | 471 | if (err == -EAGAIN) { |
472 | err = snd_hdac_power_up_pm(codec); | 472 | err = snd_hdac_power_up_pm(codec); |
473 | if (!err) | 473 | if (err >= 0) |
474 | err = reg_raw_read(codec, reg, val, uncached); | 474 | err = reg_raw_read(codec, reg, val, uncached); |
475 | snd_hdac_power_down_pm(codec); | 475 | snd_hdac_power_down_pm(codec); |
476 | } | 476 | } |