Commit 0ba0dfd9 authored by Richard Fitzgerald's avatar Richard Fitzgerald Committed by Takashi Iwai

ALSA: hda/cs35l56: cs_dsp_power_down() on cs35l56_hda_fw_load() error path

If cs35l56_hda_fw_load() successfully called cs_dsp_power_up() the error
path must balance that with a call to cs_dsp_power_down().
Signed-off-by: default avatarRichard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230731165726.7940-7-rf@opensource.cirrus.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent fb78d73d
...@@ -567,20 +567,20 @@ static int cs35l56_hda_fw_load(struct cs35l56_hda *cs35l56) ...@@ -567,20 +567,20 @@ static int cs35l56_hda_fw_load(struct cs35l56_hda *cs35l56)
if (cs35l56->base.secured) { if (cs35l56->base.secured) {
ret = cs35l56_mbox_send(&cs35l56->base, CS35L56_MBOX_CMD_AUDIO_REINIT); ret = cs35l56_mbox_send(&cs35l56->base, CS35L56_MBOX_CMD_AUDIO_REINIT);
if (ret) if (ret)
goto err; goto err_powered_up;
} else if (wmfw_firmware || coeff_firmware) { } else if (wmfw_firmware || coeff_firmware) {
/* If we downloaded firmware, reset the device and wait for it to boot */ /* If we downloaded firmware, reset the device and wait for it to boot */
cs35l56_system_reset(&cs35l56->base, false); cs35l56_system_reset(&cs35l56->base, false);
regcache_mark_dirty(cs35l56->base.regmap); regcache_mark_dirty(cs35l56->base.regmap);
ret = cs35l56_wait_for_firmware_boot(&cs35l56->base); ret = cs35l56_wait_for_firmware_boot(&cs35l56->base);
if (ret) if (ret)
goto err; goto err_powered_up;
} }
/* Disable auto-hibernate so that runtime_pm has control */ /* Disable auto-hibernate so that runtime_pm has control */
ret = cs35l56_mbox_send(&cs35l56->base, CS35L56_MBOX_CMD_PREVENT_AUTO_HIBERNATE); ret = cs35l56_mbox_send(&cs35l56->base, CS35L56_MBOX_CMD_PREVENT_AUTO_HIBERNATE);
if (ret) if (ret)
goto err; goto err_powered_up;
regcache_sync(cs35l56->base.regmap); regcache_sync(cs35l56->base.regmap);
...@@ -592,6 +592,9 @@ static int cs35l56_hda_fw_load(struct cs35l56_hda *cs35l56) ...@@ -592,6 +592,9 @@ static int cs35l56_hda_fw_load(struct cs35l56_hda *cs35l56)
if (ret) if (ret)
dev_dbg(cs35l56->base.dev, "%s: cs_dsp_run ret %d\n", __func__, ret); dev_dbg(cs35l56->base.dev, "%s: cs_dsp_run ret %d\n", __func__, ret);
err_powered_up:
if (!cs35l56->base.fw_patched)
cs_dsp_power_down(&cs35l56->cs_dsp);
err: err:
pm_runtime_put(cs35l56->base.dev); pm_runtime_put(cs35l56->base.dev);
mutex_unlock(&cs35l56->base.irq_lock); mutex_unlock(&cs35l56->base.irq_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment