drm/amd/pm: fix get dpm level count for yello carp
authorJesse Zhang <jesse.zhang@amd.com>
Thu, 9 May 2024 09:33:20 +0000 (17:33 +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/yellow_carp_ppt.c

index 5917c88..260c339 100644 (file)
@@ -777,7 +777,7 @@ static int yellow_carp_get_dpm_level_count(struct smu_context *smu,
                *count = clk_table->NumDfPstatesEnabled;
                break;
        default:
-               break;
+               return -EINVAL;
        }
 
        return 0;