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.
Unified · Split
| @@ -372,7 +372,7 @@ static int hda_dsp_boot_imr(struct snd_sof_dev *sdev) · 371 unmodified lines | |||
| 372 | int ret; | 372 | int ret; |
| 373 | 373 | ||
| 374 | ret = cl_dsp_init(sdev, 0, true); | 374 | ret = cl_dsp_init(sdev, 0, true); |
| 375 | if (ret >= 0) | 375 | if (!ret) |
| 376 | hda_sdw_process_wakeen(sdev); | 376 | hda_sdw_process_wakeen(sdev); |
| 377 | 377 | ||
| 378 | return ret; | 378 | return ret; |
| @@ -393,8 +393,8 @@ int hda_dsp_cl_boot_firmware(struct snd_sof_dev *sdev) · 14 unmodified lines | |||
| 393 | dev_dbg(sdev->dev, "IMR restore supported, booting from IMR directly\n"); | 393 | dev_dbg(sdev->dev, "IMR restore supported, booting from IMR directly\n"); |
| 394 | hda->boot_iteration = 0; | 394 | hda->boot_iteration = 0; |
| 395 | ret = hda_dsp_boot_imr(sdev); | 395 | ret = hda_dsp_boot_imr(sdev); |
| 396 | if (ret >= 0) | 396 | if (!ret) |
| 397 | return ret; | 397 | return 0; |
| 398 | 398 | ||
| 399 | dev_warn(sdev->dev, "IMR restore failed, trying to cold boot\n"); | 399 | dev_warn(sdev->dev, "IMR restore failed, trying to cold boot\n"); |
| 400 | } | 400 | } |