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