diff options
| author | yipechai <[email protected]> | 2022-02-08 02:30:31 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2022-02-14 20:08:41 +0000 |
| commit | 634b56b0f88bda4a20f88af2f3d8bb212ed53027 (patch) | |
| tree | 7aeaf30dee52959f8a723c99e0ee6f894955350f /drivers/gpu/drm/amd/amdgpu/amdgpu_hdp.c | |
| parent | drm/amdgpu: Optimize amdgpu_gfx_ras_late_init/amdgpu_gfx_ras_fini function code (diff) | |
| download | kernel-634b56b0f88bda4a20f88af2f3d8bb212ed53027.tar.gz kernel-634b56b0f88bda4a20f88af2f3d8bb212ed53027.zip | |
drm/amdgpu: Optimize amdgpu_hdp_ras_late_init/amdgpu_hdp_ras_fini function code
Optimize amdgpu_hdp_ras_late_init/amdgpu_hdp_ras_fini function code.
Signed-off-by: yipechai <[email protected]>
Reviewed-by: Tao Zhou <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_hdp.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_hdp.c | 37 |
1 files changed, 3 insertions, 34 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_hdp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_hdp.c index 518966a26130..21a5f884dd2a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_hdp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_hdp.c @@ -26,43 +26,12 @@ int amdgpu_hdp_ras_late_init(struct amdgpu_device *adev, void *ras_info) { - int r; - struct ras_ih_if ih_info = { - .cb = NULL, - }; - struct ras_fs_if fs_info = { - .sysfs_name = "hdp_err_count", - }; - - if (!adev->hdp.ras_if) { - adev->hdp.ras_if = kmalloc(sizeof(struct ras_common_if), GFP_KERNEL); - if (!adev->hdp.ras_if) - return -ENOMEM; - adev->hdp.ras_if->block = AMDGPU_RAS_BLOCK__HDP; - adev->hdp.ras_if->type = AMDGPU_RAS_ERROR__MULTI_UNCORRECTABLE; - adev->hdp.ras_if->sub_block_index = 0; - } - ih_info.head = fs_info.head = *adev->hdp.ras_if; - r = amdgpu_ras_late_init(adev, adev->hdp.ras_if, - &fs_info, &ih_info); - if (r || !amdgpu_ras_is_supported(adev, adev->hdp.ras_if->block)) { - kfree(adev->hdp.ras_if); - adev->hdp.ras_if = NULL; - } - - return r; + return amdgpu_ras_block_late_init(adev, adev->hdp.ras_if); } void amdgpu_hdp_ras_fini(struct amdgpu_device *adev) { if (amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__HDP) && - adev->hdp.ras_if) { - struct ras_common_if *ras_if = adev->hdp.ras_if; - struct ras_ih_if ih_info = { - .cb = NULL, - }; - - amdgpu_ras_late_fini(adev, ras_if, &ih_info); - kfree(ras_if); - } + adev->hdp.ras_if) + amdgpu_ras_block_late_fini(adev, adev->hdp.ras_if); } |
