amdgpu/pm: Replace smu12/13 usage of sprintf with sysfs_emit
authorDarren Powell <darren.powell@amd.com>
Sat, 10 Jul 2021 03:58:39 +0000 (23:58 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 10 Aug 2021 14:34:50 +0000 (10:34 -0400)
commite738c2f0e654832f9209a962c5020741aee30620
tree33104798dc705af5827ca1d8b08c6441ecf4e568
parentfe14c2859ffd18ecec263b0e24a5737478ae2529
amdgpu/pm: Replace smu12/13 usage of sprintf with sysfs_emit

 initial modification of files
  renoir_ppt.c
  aldebaran_ppt.c
  yellow_carp_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_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/smu12/renoir_ppt.c
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c