drm/amdgpu: Add ras supported check for register_ras_block

Add ras supported check for register_ras_block.

Signed-off-by: yipechai <YiPeng.Chai@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
yipechai 2022-01-11 16:45:19 +08:00 committed by Alex Deucher
parent c4381d0ee8
commit df01fe73ee

View File

@ -2756,6 +2756,9 @@ int amdgpu_ras_register_ras_block(struct amdgpu_device *adev,
if (!adev || !ras_block_obj)
return -EINVAL;
if (!amdgpu_ras_asic_supported(adev))
return 0;
INIT_LIST_HEAD(&ras_block_obj->node);
list_add_tail(&ras_block_obj->node, &adev->ras_list);