drm/amd/pm: return -ENOTSUPP if there is no get_dpm_ultimate_freq function
authorTom Rix <trix@redhat.com>
Mon, 24 Jan 2022 20:18:12 +0000 (12:18 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:23:26 +0000 (14:23 +0200)
commitb175bc58641032cfdb89f92afd76939be2ae22b4
treeaaf04d205e7ae95810f0257ea33e15beb690b8a0
parentbdc7429708a0772d90c208975694f7c2133b1202
drm/amd/pm: return -ENOTSUPP if there is no get_dpm_ultimate_freq function

[ Upstream commit 430e6a0212b2a0eb1de5e9d47a016fa79edf3978 ]

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: e5ef784b1e17 ("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>
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c