Commit fd2cea16 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Mark Brown

ASoC: SOF: Intel: Do not (wrongly) assume positive return value in IMR path

The cl_dsp_init() returns 0 on success or negative errno on error.
Replace the 'if (ret >= 0)' checks with correct 'if (!ret)` to check for
success.

Fixes: 2a68ff84 ("ASoC: SOF: Intel: hda: Revisit IMR boot sequence")
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220427115159.26177-1-peter.ujfalusi@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent d879e944
......@@ -372,7 +372,7 @@ static int hda_dsp_boot_imr(struct snd_sof_dev *sdev)
int ret;
ret = cl_dsp_init(sdev, 0, true);
if (ret >= 0)
if (!ret)
hda_sdw_process_wakeen(sdev);
return ret;
......@@ -393,8 +393,8 @@ int hda_dsp_cl_boot_firmware(struct snd_sof_dev *sdev)
dev_dbg(sdev->dev, "IMR restore supported, booting from IMR directly\n");
hda->boot_iteration = 0;
ret = hda_dsp_boot_imr(sdev);
if (ret >= 0)
return ret;
if (!ret)
return 0;
dev_warn(sdev->dev, "IMR restore failed, trying to cold boot\n");
}
......
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