diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-07-17 17:27:33 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-07-17 17:27:33 +0300 |
commit | fbce23a0b95763dfc4961ce6240e055c39f497ed (patch) | |
tree | cfd7a1a394f38e2210ca93432b3a3dd60836a4fd /sound/hda/hdac_regmap.c | |
parent | 6986a0e2556df3dfb54c624b50b02936bd1e00ef (diff) | |
download | linux-fbce23a0b95763dfc4961ce6240e055c39f497ed.tar.xz |
ALSA: hda - Check the return value from pm_runtime_get/put*()
This patch changes the return type of snd_hdac_power_up/down() and
variants to pass the error code from the underlying
pm_runtime_get/put() calls. Currently they are ignored, but in most
places, these should be handled properly.
As an example, the regmap handler is updated to check the return value
and accesses the register only when the wakeup succeeds.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/hda/hdac_regmap.c')
-rw-r--r-- | sound/hda/hdac_regmap.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sound/hda/hdac_regmap.c b/sound/hda/hdac_regmap.c index 1eabcdf69457..b0ed870ffb88 100644 --- a/sound/hda/hdac_regmap.c +++ b/sound/hda/hdac_regmap.c @@ -410,8 +410,9 @@ int snd_hdac_regmap_write_raw(struct hdac_device *codec, unsigned int reg, err = reg_raw_write(codec, reg, val); if (err == -EAGAIN) { - snd_hdac_power_up_pm(codec); - err = reg_raw_write(codec, reg, val); + err = snd_hdac_power_up_pm(codec); + if (!err) + err = reg_raw_write(codec, reg, val); snd_hdac_power_down_pm(codec); } return err; @@ -442,8 +443,9 @@ int snd_hdac_regmap_read_raw(struct hdac_device *codec, unsigned int reg, err = reg_raw_read(codec, reg, val); if (err == -EAGAIN) { - snd_hdac_power_up_pm(codec); - err = reg_raw_read(codec, reg, val); + err = snd_hdac_power_up_pm(codec); + if (!err) + err = reg_raw_read(codec, reg, val); snd_hdac_power_down_pm(codec); } return err; |