drm/amd/pm: Fix output of pp_od_clk_voltage
authorjsg <jsg@openbsd.org>
Fri, 16 Jun 2023 00:51:02 +0000 (00:51 +0000)
committerjsg <jsg@openbsd.org>
Fri, 16 Jun 2023 00:51:02 +0000 (00:51 +0000)
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

index 393d79a..ef5f21e 100644 (file)
@@ -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)