drm/amdgpu: Fix missing mca debugfs node
authorYang Wang <kevinyang.wang@amd.com>
Thu, 30 Nov 2023 04:58:14 +0000 (12:58 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 30 Nov 2023 23:26:22 +0000 (18:26 -0500)
Use amdgpu_ip_version() helper function to check ip version.

The ip version contains other information,
use the helper function to avoid reading wrong value.

Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Yang Wang <kevinyang.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c

index 54f2f346579edc08264d7c52dd87cba4e33b9608..210aea590a52ed7bc87c98776e5fd5107e0e7aea 100644 (file)
@@ -485,7 +485,7 @@ DEFINE_DEBUGFS_ATTRIBUTE(mca_debug_mode_fops, NULL, amdgpu_mca_smu_debug_mode_se
 void amdgpu_mca_smu_debugfs_init(struct amdgpu_device *adev, struct dentry *root)
 {
 #if defined(CONFIG_DEBUG_FS)
-       if (!root || adev->ip_versions[MP1_HWIP][0] != IP_VERSION(13, 0, 6))
+       if (!root || amdgpu_ip_version(adev, MP1_HWIP, 0) != IP_VERSION(13, 0, 6))
                return;
 
        debugfs_create_file("mca_debug_mode", 0200, root, adev, &mca_debug_mode_fops);