summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
diff options
context:
space:
mode:
authorMario Limonciello <mario.limonciello@amd.com>2023-01-03 23:12:37 +0300
committerAlex Deucher <alexander.deucher@amd.com>2023-01-10 01:02:18 +0300
commit11e0b0067ec0707e8e598a5f9a547ab618ae7982 (patch)
tree5a86dddf3191f4b0c9bae93fe30e47989c2f077f /drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
parentcc42e76e7de5190a7da5dac9d7b2bbb458e050bf (diff)
downloadlinux-11e0b0067ec0707e8e598a5f9a547ab618ae7982.tar.xz
drm/amd: Use `amdgpu_ucode_*` helpers for MES
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper provides symmetry for releasing firmware. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
index dd8f35234507..82e27bd4f038 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
@@ -1438,11 +1438,7 @@ int amdgpu_mes_init_microcode(struct amdgpu_device *adev, int pipe)
snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mes%s.bin",
ucode_prefix,
pipe == AMDGPU_MES_SCHED_PIPE ? "" : "1");
- r = request_firmware(&adev->mes.fw[pipe], fw_name, adev->dev);
- if (r)
- goto out;
-
- r = amdgpu_ucode_validate(adev->mes.fw[pipe]);
+ r = amdgpu_ucode_request(adev, &adev->mes.fw[pipe], fw_name);
if (r)
goto out;
@@ -1482,9 +1478,7 @@ int amdgpu_mes_init_microcode(struct amdgpu_device *adev, int pipe)
}
return 0;
-
out:
- release_firmware(adev->mes.fw[pipe]);
- adev->mes.fw[pipe] = NULL;
+ amdgpu_ucode_release(&adev->mes.fw[pipe]);
return r;
}