drm/amd/pm: return -ENOTSUPP if there is no get_dpm_ultimate_freq function

[ Upstream commit 430e6a0212 ]

clang static analysis reports this represenative problem
amdgpu_smu.c:144:18: warning: The left operand of '*' is a garbage value
        return clk_freq * 100;
               ~~~~~~~~ ^

If there is no get_dpm_ultimate_freq function,
smu_get_dpm_freq_range returns success without setting the
output min,max parameters.  So return an -ENOTSUPP error.

Fixes: e5ef784b1e ("drm/amd/powerplay: revise calling chain on retrieving frequency range")
Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Tom Rix 2022-01-24 12:18:12 -08:00 коммит произвёл Greg Kroah-Hartman
Родитель bdc7429708
Коммит b175bc5864
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -138,7 +138,7 @@ int smu_get_dpm_freq_range(struct smu_context *smu,
uint32_t *min, uint32_t *min,
uint32_t *max) uint32_t *max)
{ {
int ret = 0; int ret = -ENOTSUPP;
if (!min && !max) if (!min && !max)
return -EINVAL; return -EINVAL;