aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
diff options
context:
space:
mode:
authorRex Zhu <Rex.Zhu@amd.com>2017-09-22 05:47:27 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-09-28 16:03:31 -0400
commitd2f52ac800fec229f2931603e8b7fb9c5ade7aa7 (patch)
treeff223b1869d19521e53f18aed47aacf088ff997c /drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
parentc98171ccf6580407d07a3b5dc8188ce9e1f4f7ca (diff)
drm/amdgpu: move common pm sysfs code to amdgpu_device.c
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
index f6ce52956e6d..274886cedb66 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
@@ -1317,6 +1317,9 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev)
1317 if (adev->pm.sysfs_initialized) 1317 if (adev->pm.sysfs_initialized)
1318 return 0; 1318 return 0;
1319 1319
1320 if (adev->pm.dpm_enabled == 0)
1321 return 0;
1322
1320 if (adev->powerplay.pp_funcs->get_temperature == NULL) 1323 if (adev->powerplay.pp_funcs->get_temperature == NULL)
1321 return 0; 1324 return 0;
1322 1325
@@ -1417,6 +1420,9 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev)
1417 1420
1418void amdgpu_pm_sysfs_fini(struct amdgpu_device *adev) 1421void amdgpu_pm_sysfs_fini(struct amdgpu_device *adev)
1419{ 1422{
1423 if (adev->pm.dpm_enabled == 0)
1424 return;
1425
1420 if (adev->pm.int_hwmon_dev) 1426 if (adev->pm.int_hwmon_dev)
1421 hwmon_device_unregister(adev->pm.int_hwmon_dev); 1427 hwmon_device_unregister(adev->pm.int_hwmon_dev);
1422 device_remove_file(adev->dev, &dev_attr_power_dpm_state); 1428 device_remove_file(adev->dev, &dev_attr_power_dpm_state);