Merge tag 'drm-misc-next-fixes-2021-09-09' of git://anongit.freedesktop.org/drm/drm...
[linux-2.6-microblaze.git] / drivers / gpu / drm / amd / pm / swsmu / smu12 / renoir_ppt.c
index 9a9c24a..5aa175e 100644 (file)
@@ -426,7 +426,7 @@ static int renoir_od_edit_dpm_table(struct smu_context *smu,
                } else {
                        if (smu->gfx_actual_hard_min_freq > smu->gfx_actual_soft_max_freq) {
                                dev_err(smu->adev->dev,
-                                       "The setting minimun sclk (%d) MHz is greater than the setting maximum sclk (%d) MHz\n",
+                                       "The setting minimum sclk (%d) MHz is greater than the setting maximum sclk (%d) MHz\n",
                                        smu->gfx_actual_hard_min_freq,
                                        smu->gfx_actual_soft_max_freq);
                                return -EINVAL;
@@ -510,16 +510,16 @@ static int renoir_print_clk_levels(struct smu_context *smu,
                                                0, &max);
                        if (ret)
                                return ret;
-                       size += sprintf(buf + size, "OD_RANGE\nSCLK: %10uMhz %10uMhz\n", min, max);
+                       size += sysfs_emit_at(buf, size, "OD_RANGE\nSCLK: %10uMhz %10uMhz\n", min, max);
                }
                break;
        case SMU_OD_SCLK:
                if (smu_dpm_ctx->dpm_level == AMD_DPM_FORCED_LEVEL_MANUAL) {
                        min = (smu->gfx_actual_hard_min_freq > 0) ? smu->gfx_actual_hard_min_freq : smu->gfx_default_hard_min_freq;
                        max = (smu->gfx_actual_soft_max_freq > 0) ? smu->gfx_actual_soft_max_freq : smu->gfx_default_soft_max_freq;
-                       size += sprintf(buf + size, "OD_SCLK\n");
-                       size += sprintf(buf + size, "0:%10uMhz\n", min);
-                       size += sprintf(buf + size, "1:%10uMhz\n", max);
+                       size += sysfs_emit_at(buf, size, "OD_SCLK\n");
+                       size += sysfs_emit_at(buf, size, "0:%10uMhz\n", min);
+                       size += sysfs_emit_at(buf, size, "1:%10uMhz\n", max);
                }
                break;
        case SMU_GFXCLK:
@@ -536,12 +536,12 @@ static int renoir_print_clk_levels(struct smu_context *smu,
                        else
                                i = 1;
 
-                       size += sprintf(buf + size, "0: %uMhz %s\n", min,
+                       size += sysfs_emit_at(buf, size, "0: %uMhz %s\n", min,
                                        i == 0 ? "*" : "");
-                       size += sprintf(buf + size, "1: %uMhz %s\n",
+                       size += sysfs_emit_at(buf, size, "1: %uMhz %s\n",
                                        i == 1 ? cur_value : RENOIR_UMD_PSTATE_GFXCLK,
                                        i == 1 ? "*" : "");
-                       size += sprintf(buf + size, "2: %uMhz %s\n", max,
+                       size += sysfs_emit_at(buf, size, "2: %uMhz %s\n", max,
                                        i == 2 ? "*" : "");
                }
                return size;
@@ -588,14 +588,14 @@ static int renoir_print_clk_levels(struct smu_context *smu,
                                return ret;
                        if (!value)
                                continue;
-                       size += sprintf(buf + size, "%d: %uMhz %s\n", i, value,
+                       size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n", i, value,
                                        cur_value == value ? "*" : "");
                        if (cur_value == value)
                                cur_value_match_level = true;
                }
 
                if (!cur_value_match_level)
-                       size += sprintf(buf + size, "   %uMhz *\n", cur_value);
+                       size += sysfs_emit_at(buf, size, "   %uMhz *\n", cur_value);
 
                break;
        default:
@@ -1118,7 +1118,7 @@ static int renoir_get_power_profile_mode(struct smu_context *smu,
                if (workload_type < 0)
                        continue;
 
-               size += sprintf(buf + size, "%2d %14s%s\n",
+               size += sysfs_emit_at(buf, size, "%2d %14s%s\n",
                        i, profile_name[i], (i == smu->power_profile_mode) ? "*" : " ");
        }