summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/aldebaran.c
diff options
context:
space:
mode:
authorSunil Khatri <sunil.khatri@amd.com>2024-10-17 19:17:22 +0530
committerAlex Deucher <alexander.deucher@amd.com>2024-10-22 17:50:39 -0400
commite095026f0066eca05268b20a6f378cf31bedc54b (patch)
treeea958eefac83c657404dccf764bea116a4db3b35 /drivers/gpu/drm/amd/amdgpu/aldebaran.c
parentdad01f93f432d4a2456860f7f55fdb762d2982a4 (diff)
drm/amdgpu: validate suspend before function call
Before making a function call to suspend, validate the function pointer like we do in sw_init. Use the helper function amdgpu_ip_block_suspend where same checks and calls are repeated. Signed-off-by: Sunil Khatri <sunil.khatri@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/aldebaran.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/aldebaran.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/aldebaran.c b/drivers/gpu/drm/amd/amdgpu/aldebaran.c
index c1ff24335a0c..07f195a89e9a 100644
--- a/drivers/gpu/drm/amd/amdgpu/aldebaran.c
+++ b/drivers/gpu/drm/amd/amdgpu/aldebaran.c
@@ -85,16 +85,9 @@ static int aldebaran_mode2_suspend_ip(struct amdgpu_device *adev)
AMD_IP_BLOCK_TYPE_SDMA))
continue;
- r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
-
- if (r) {
- dev_err(adev->dev,
- "suspend of IP block <%s> failed %d\n",
- adev->ip_blocks[i].version->funcs->name, r);
+ r = amdgpu_ip_block_suspend(&adev->ip_blocks[i]);
+ if (r)
return r;
- }
-
- adev->ip_blocks[i].status.hw = false;
}
return 0;