From fd26339b101422c14d083f1abfd54900947d9c5c Mon Sep 17 00:00:00 2001 From: jsg Date: Fri, 16 Jun 2023 00:51:02 +0000 Subject: [PATCH] drm/amd/pm: Fix output of pp_od_clk_voltage From Jonatas Esteves 8069bcaa5b392ce3972dd72f184b2cc4b1b8262b in linux-6.1.y/6.1.31 40baba5693b9af586dc1063af603d05a79e57a6b in mainline linux --- sys/dev/pci/drm/amd/pm/amdgpu_pm.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sys/dev/pci/drm/amd/pm/amdgpu_pm.c b/sys/dev/pci/drm/amd/pm/amdgpu_pm.c index 393d79acfcd..ef5f21e3ffa 100644 --- a/sys/dev/pci/drm/amd/pm/amdgpu_pm.c +++ b/sys/dev/pci/drm/amd/pm/amdgpu_pm.c @@ -871,13 +871,11 @@ static ssize_t amdgpu_get_pp_od_clk_voltage(struct device *dev, } if (ret == -ENOENT) { size = amdgpu_dpm_print_clock_levels(adev, OD_SCLK, buf); - if (size > 0) { - size += amdgpu_dpm_print_clock_levels(adev, OD_MCLK, buf + size); - size += amdgpu_dpm_print_clock_levels(adev, OD_VDDC_CURVE, buf + size); - size += amdgpu_dpm_print_clock_levels(adev, OD_VDDGFX_OFFSET, buf + size); - size += amdgpu_dpm_print_clock_levels(adev, OD_RANGE, buf + size); - size += amdgpu_dpm_print_clock_levels(adev, OD_CCLK, buf + size); - } + size += amdgpu_dpm_print_clock_levels(adev, OD_MCLK, buf + size); + size += amdgpu_dpm_print_clock_levels(adev, OD_VDDC_CURVE, buf + size); + size += amdgpu_dpm_print_clock_levels(adev, OD_VDDGFX_OFFSET, buf + size); + size += amdgpu_dpm_print_clock_levels(adev, OD_RANGE, buf + size); + size += amdgpu_dpm_print_clock_levels(adev, OD_CCLK, buf + size); } if (size == 0) -- 2.20.1