From: Guchun Chen Date: Mon, 9 Aug 2021 07:44:29 +0000 (+0800) Subject: drm/amd/display: fix error case handling X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=2cbc6f4259f6e4d86a3e92008e55bef106aa2d24;p=linux.git drm/amd/display: fix error case handling Otherwise, we will run into error case path. v2: fix build when CONFIG_DRM_AMD_DC_DCN is not set Acked-by: Christian König Signed-off-by: Guchun Chen Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 7e83c4db99fc7..78f11a727e001 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -4211,11 +4211,12 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev) } break; default: - break; + DRM_ERROR("Unsupported DCE IP versions: 0x%X\n", + adev->ip_versions[DCE_HWIP]); + goto fail; } #endif - DRM_ERROR("Unsupported ASIC type: 0x%X\n", adev->asic_type); - goto fail; + break; } return 0; @@ -4394,11 +4395,12 @@ static int dm_early_init(void *handle) adev->mode_info.num_dig = 4; break; default: - break; + DRM_ERROR("Unsupported DCE IP versions: 0x%x\n", + adev->ip_versions[DCE_HWIP]); + return -EINVAL; } #endif - DRM_ERROR("Unsupported ASIC type: 0x%X\n", adev->asic_type); - return -EINVAL; + break; } amdgpu_dm_set_irq_funcs(adev);