Commit 59d0f396 authored by Alex Deucher's avatar Alex Deucher

drm/amdgpu/display: return proper error codes in dm

Replace -1 with proper error codes.
Acked-by: default avatarHuang Rui <ray.huang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 741deade
...@@ -493,7 +493,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) ...@@ -493,7 +493,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
error: error:
amdgpu_dm_fini(adev); amdgpu_dm_fini(adev);
return -1; return -EINVAL;
} }
static void amdgpu_dm_fini(struct amdgpu_device *adev) static void amdgpu_dm_fini(struct amdgpu_device *adev)
...@@ -548,7 +548,7 @@ static int load_dmcu_fw(struct amdgpu_device *adev) ...@@ -548,7 +548,7 @@ static int load_dmcu_fw(struct amdgpu_device *adev)
break; break;
default: default:
DRM_ERROR("Unsupported ASIC type: 0x%X\n", adev->asic_type); DRM_ERROR("Unsupported ASIC type: 0x%X\n", adev->asic_type);
return -1; return -EINVAL;
} }
if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP) { if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP) {
...@@ -1539,7 +1539,7 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev) ...@@ -1539,7 +1539,7 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
link_cnt = dm->dc->caps.max_links; link_cnt = dm->dc->caps.max_links;
if (amdgpu_dm_mode_config_init(dm->adev)) { if (amdgpu_dm_mode_config_init(dm->adev)) {
DRM_ERROR("DM: Failed to initialize mode config\n"); DRM_ERROR("DM: Failed to initialize mode config\n");
return -1; return -EINVAL;
} }
/* Identify the number of planes to be initialized */ /* Identify the number of planes to be initialized */
...@@ -1654,7 +1654,7 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev) ...@@ -1654,7 +1654,7 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
kfree(aconnector); kfree(aconnector);
for (i = 0; i < dm->dc->caps.max_planes; i++) for (i = 0; i < dm->dc->caps.max_planes; i++)
kfree(mode_info->planes[i]); kfree(mode_info->planes[i]);
return -1; return -EINVAL;
} }
static void amdgpu_dm_destroy_drm_device(struct amdgpu_display_manager *dm) static void amdgpu_dm_destroy_drm_device(struct amdgpu_display_manager *dm)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment