[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231009115437.99976-5-maarten.lankhorst@linux.intel.com>
Date: Mon, 9 Oct 2023 13:54:28 +0200
From: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>
To: alsa-devel@...a-project.org
Cc: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Cezary Rojewski <cezary.rojewski@...el.com>,
Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
Liam Girdwood <liam.r.girdwood@...ux.intel.com>,
Peter Ujfalusi <peter.ujfalusi@...ux.intel.com>,
Bard Liao <yung-chuan.liao@...ux.intel.com>,
Ranjani Sridharan <ranjani.sridharan@...ux.intel.com>,
Kai Vehmanen <kai.vehmanen@...ux.intel.com>,
Mark Brown <broonie@...nel.org>,
Daniel Baluta <daniel.baluta@....com>,
linux-kernel@...r.kernel.org, sound-open-firmware@...a-project.org
Subject: [PATCH v7 04/13] ASoC: SOF: Intel: Fix error handling in hda_init()
The hda_codec_i915_init() errors are ignored in
hda_init() so it can never return -EPROBE_DEFER.
Fix this before we move the call to hda_init() from the
deferred probe to early probe.
While at it, also fix error handling when hda_dsp_ctrl_get_caps
fails.
Suggested-by: Kai Vehmanen <kai.vehmanen@...ux.intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@...ux.intel.com>
---
sound/soc/sof/intel/hda.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
index 86a2571488bcc..2f189473323f3 100644
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -848,13 +848,21 @@ static int hda_init(struct snd_sof_dev *sdev)
/* init i915 and HDMI codecs */
ret = hda_codec_i915_init(sdev);
- if (ret < 0)
- dev_warn(sdev->dev, "init of i915 and HDMI codec failed\n");
+ if (ret < 0 && ret != -ENODEV) {
+ dev_err_probe(sdev->dev, ret, "init of i915 and HDMI codec failed\n");
+ goto out;
+ }
/* get controller capabilities */
ret = hda_dsp_ctrl_get_caps(sdev);
- if (ret < 0)
+ if (ret < 0) {
dev_err(sdev->dev, "error: get caps error\n");
+ hda_codec_i915_exit(sdev);
+ }
+
+out:
+ if (ret < 0)
+ iounmap(sof_to_bus(sdev)->remap_addr);
return ret;
}
--
2.39.2
Powered by blists - more mailing lists