drm/amd/pm: fix get dpm level count for smu13
authorJesse Zhang <jesse.zhang@amd.com>
Thu, 9 May 2024 09:20:24 +0000 (17:20 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 13 May 2024 20:11:52 +0000 (16:11 -0400)
For invalid clk types, return -EINVAL to check the return.

Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_5_ppt.c

index 5985446..9c2c43b 100644 (file)
@@ -643,7 +643,7 @@ static int smu_v13_0_5_get_dpm_level_count(struct smu_context *smu,
                *count = clk_table->NumDfPstatesEnabled;
                break;
        default:
-               break;
+               return -EINVAL;
        }
 
        return 0;