amdgpu/pm: Replace navi10 usage of sprintf with sysfs_emit
authorDarren Powell <darren.powell@amd.com>
Wed, 30 Jun 2021 22:31:51 +0000 (18:31 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 10 Aug 2021 14:34:37 +0000 (10:34 -0400)
commit828db598bfcdad388d85c1ff31e530c190d63d16
treed20fb77ac7f39ff3569773a035db444f8e03ab62
parent59066d0083d2e0f2daba9cf839011f7154c5e2b2
amdgpu/pm: Replace navi10 usage of sprintf with sysfs_emit

 initial modification of files
  smu_cmn.c
  navi10_ppt.c

=== Test ===
AMDGPU_PCI_ADDR=`lspci -nn | grep "VGA\|Display" | cut -d " " -f 1`
AMDGPU_HWMON=`ls -la /sys/class/hwmon | grep $AMDGPU_PCI_ADDR | awk '{print $9}'`
HWMON_DIR=/sys/class/hwmon/${AMDGPU_HWMON}
LOGFILE=pp_printf.test.log

lspci -nn | grep "VGA\|Display"  > $LOGFILE
FILES="pp_dpm_sclk
pp_sclk_od
pp_mclk_od
pp_dpm_pcie
pp_od_clk_voltage
pp_power_profile_mode "

for f in $FILES
do
  echo === $f === >> $LOGFILE
  cat $HWMON_DIR/device/$f >> $LOGFILE
done
cat $LOGFILE

Signed-off-by: Darren Powell <darren.powell@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c