diff options
author | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2023-10-09 14:54:28 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2023-10-19 15:54:49 +0300 |
commit | 03448e5df586c79f9c88d8cbe29014820cc2904f (patch) | |
tree | 73136817cfc536002a1abb6e022a1cd31d9d802a /sound/soc/sof | |
parent | f1977d5ba07178b17320e4d694e9cc1d81da9308 (diff) | |
download | linux-03448e5df586c79f9c88d8cbe29014820cc2904f.tar.xz |
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@linux.intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20231009115437.99976-5-maarten.lankhorst@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/soc/sof')
-rw-r--r-- | sound/soc/sof/intel/hda.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index 86a2571488bc..2f189473323f 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; } |