History

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.

Peter Ujfalusi committed 4 years ago

Commit fd2cea11 parent d879e941 file · +3 −3Browse files

Unified · Split

sound/soc/sof/intel/hda-loader.c+3−3
@@ -372,7 +372,7 @@ static int hda_dsp_boot_imr(struct snd_sof_dev *sdev) · 371 unmodified lines
372372 int ret;
373373
374374 ret = cl_dsp_init(sdev, 0, true);
375− if (ret >= 0)
375+ if (!ret)
376376 hda_sdw_process_wakeen(sdev);
377377
378378 return ret;
@@ -393,8 +393,8 @@ int hda_dsp_cl_boot_firmware(struct snd_sof_dev *sdev) · 14 unmodified lines
393393 dev_dbg(sdev->dev, "IMR restore supported, booting from IMR directly\n");
394394 hda->boot_iteration = 0;
395395 ret = hda_dsp_boot_imr(sdev);
396− if (ret >= 0)
397− return ret;
396+ if (!ret)
397+ return 0;
398398
399399 dev_warn(sdev->dev, "IMR restore failed, trying to cold boot\n");
400400 }