diff options
author | Yushan Zhou <katrinzhou@tencent.com> | 2022-11-23 15:44:37 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2022-11-29 11:03:37 -0500 |
commit | 5a2a19b7ac59d667d6a3221e7d50b4ab9937792b (patch) | |
tree | 36fbbc1614e3db4ff78de82329698f26e5d1e9a2 /drivers/gpu/drm | |
parent | 65009bf2b4d287ef7ad7e6eb082b7c3d35eb611f (diff) | |
download | linux-5a2a19b7ac59d667d6a3221e7d50b4ab9937792b.tar.bz2 |
drm/amdgpu: remove redundant NULL check
release_firmware() checks whether firmware pointer is NULL.
Remove the redundant NULL check in psp_sw_fini().
Signed-off-by: Yushan Zhou <katrinzhou@tencent.com>
Reviewed-by: Luben Tuikov <luben.tuikov@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index fe1638532ab8..5f6c002aa0c8 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -513,26 +513,22 @@ static int psp_sw_fini(void *handle) struct psp_gfx_cmd_resp *cmd = psp->cmd; psp_memory_training_fini(psp); - if (psp->sos_fw) { - release_firmware(psp->sos_fw); - psp->sos_fw = NULL; - } - if (psp->asd_fw) { - release_firmware(psp->asd_fw); - psp->asd_fw = NULL; - } - if (psp->ta_fw) { - release_firmware(psp->ta_fw); - psp->ta_fw = NULL; - } - if (psp->cap_fw) { - release_firmware(psp->cap_fw); - psp->cap_fw = NULL; - } - if (psp->toc_fw) { - release_firmware(psp->toc_fw); - psp->toc_fw = NULL; - } + + release_firmware(psp->sos_fw); + psp->sos_fw = NULL; + + release_firmware(psp->asd_fw); + psp->asd_fw = NULL; + + release_firmware(psp->ta_fw); + psp->ta_fw = NULL; + + release_firmware(psp->cap_fw); + psp->cap_fw = NULL; + + release_firmware(psp->toc_fw); + psp->toc_fw = NULL; + if (adev->ip_versions[MP0_HWIP][0] == IP_VERSION(11, 0, 0) || adev->ip_versions[MP0_HWIP][0] == IP_VERSION(11, 0, 7)) psp_sysfs_fini(adev); |