diff options
author | Evan Quan <evan.quan@amd.com> | 2018-12-17 04:51:22 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-12-18 17:39:18 -0500 |
commit | 379c237e392e4cec09ff5853b5c0724a1e5d51b0 (patch) | |
tree | 94ed5c6ab00e812c835f06ca115d06791875eff2 /drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | |
parent | e98bdb8061305ec00ca9c11231a606e849477bc8 (diff) |
drm/amdgpu: correct the return value for error case
It should not return 0 for error case as '0' is actually
a special value for index.
Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c index 0b263a9857c6..8a8bc60cb6b4 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | |||
@@ -97,8 +97,19 @@ int amdgpu_xgmi_add_device(struct amdgpu_device *adev) | |||
97 | if (!adev->gmc.xgmi.supported) | 97 | if (!adev->gmc.xgmi.supported) |
98 | return 0; | 98 | return 0; |
99 | 99 | ||
100 | adev->gmc.xgmi.node_id = psp_xgmi_get_node_id(&adev->psp); | 100 | ret = psp_xgmi_get_node_id(&adev->psp, &adev->gmc.xgmi.node_id); |
101 | adev->gmc.xgmi.hive_id = psp_xgmi_get_hive_id(&adev->psp); | 101 | if (ret) { |
102 | dev_err(adev->dev, | ||
103 | "XGMI: Failed to get node id\n"); | ||
104 | return ret; | ||
105 | } | ||
106 | |||
107 | ret = psp_xgmi_get_hive_id(&adev->psp, &adev->gmc.xgmi.hive_id); | ||
108 | if (ret) { | ||
109 | dev_err(adev->dev, | ||
110 | "XGMI: Failed to get hive id\n"); | ||
111 | return ret; | ||
112 | } | ||
102 | 113 | ||
103 | mutex_lock(&xgmi_mutex); | 114 | mutex_lock(&xgmi_mutex); |
104 | hive = amdgpu_get_xgmi_hive(adev); | 115 | hive = amdgpu_get_xgmi_hive(adev); |