diff options
author | Tom Rix <trix@redhat.com> | 2022-01-24 12:18:12 -0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2022-01-25 18:00:36 -0500 |
commit | 430e6a0212b2a0eb1de5e9d47a016fa79edf3978 (patch) | |
tree | 6de58add1c8dfbee0989102e4223517e4c67ad07 /drivers/gpu/drm/amd/pm | |
parent | 5e6d72c643e1262ff02e057620b9f87d7d81141a (diff) |
drm/amd/pm: return -ENOTSUPP if there is no get_dpm_ultimate_freq function
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>
Diffstat (limited to 'drivers/gpu/drm/amd/pm')
-rw-r--r-- | drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c index 5ace30434e60..264eb09ccfd5 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c @@ -116,7 +116,7 @@ int smu_get_dpm_freq_range(struct smu_context *smu, uint32_t *min, uint32_t *max) { - int ret = 0; + int ret = -ENOTSUPP; if (!min && !max) return -EINVAL; |