[PATCH 50/66] drm/amd/display: fix error case handling

Alex Deucher alexander.deucher at amd.com
Tue Sep 21 18:07:09 UTC 2021


From: Guchun Chen <guchun.chen at amd.com>

Otherwise, we will run into error case path.

Signed-off-by: Guchun Chen <guchun.chen at amd.com>
Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

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 519930fe79a2..fc8a30251fa4 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -4204,11 +4204,11 @@ 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;
 	}
 
 	return 0;
@@ -4386,11 +4386,11 @@ 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;
 	}
 
 	amdgpu_dm_set_irq_funcs(adev);
-- 
2.31.1



More information about the amd-gfx mailing list