int amdgpu_ras_register_ras_block(struct amdgpu_device *adev,
struct amdgpu_ras_block_object *ras_block_obj)
{
- struct amdgpu_ras_block_object *obj, *tmp;
if (!adev || !ras_block_obj)
return -EINVAL;
if (!amdgpu_ras_asic_supported(adev))
return 0;
- /* If the ras object is in ras_list, don't add it again */
- list_for_each_entry_safe(obj, tmp, &adev->ras_list, node) {
- if (obj == ras_block_obj)
- return 0;
- }
-
INIT_LIST_HEAD(&ras_block_obj->node);
list_add_tail(&ras_block_obj->node, &adev->ras_list);