diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2015-10-19 15:49:11 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-10-19 15:53:54 -0400 |
commit | 27100735adbcb872854674bed1d000825f9954ac (patch) | |
tree | 8ab5461d7721c5923aab4a3aecf530038fd1100a /drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | |
parent | 2a7d44f47f53fa1be677f44c73d78b1bcf9c05d9 (diff) |
drm/amdgpu/dpm: don't add pwm attributes if DPM is disabled
PWM fan control is only available with DPM. There is no non-DPM
support on amdgpu, so we should never get a crash here because
the sysfs nodes would never be created in the first place. Add the
check just in case to be on the safe side.
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.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c index efed11509f4a..ed2bbe5b10af 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | |||
@@ -294,10 +294,14 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj, | |||
294 | struct amdgpu_device *adev = dev_get_drvdata(dev); | 294 | struct amdgpu_device *adev = dev_get_drvdata(dev); |
295 | umode_t effective_mode = attr->mode; | 295 | umode_t effective_mode = attr->mode; |
296 | 296 | ||
297 | /* Skip limit attributes if DPM is not enabled */ | 297 | /* Skip attributes if DPM is not enabled */ |
298 | if (!adev->pm.dpm_enabled && | 298 | if (!adev->pm.dpm_enabled && |
299 | (attr == &sensor_dev_attr_temp1_crit.dev_attr.attr || | 299 | (attr == &sensor_dev_attr_temp1_crit.dev_attr.attr || |
300 | attr == &sensor_dev_attr_temp1_crit_hyst.dev_attr.attr)) | 300 | attr == &sensor_dev_attr_temp1_crit_hyst.dev_attr.attr || |
301 | attr == &sensor_dev_attr_pwm1.dev_attr.attr || | ||
302 | attr == &sensor_dev_attr_pwm1_enable.dev_attr.attr || | ||
303 | attr == &sensor_dev_attr_pwm1_max.dev_attr.attr || | ||
304 | attr == &sensor_dev_attr_pwm1_min.dev_attr.attr)) | ||
301 | return 0; | 305 | return 0; |
302 | 306 | ||
303 | /* Skip fan attributes if fan is not present */ | 307 | /* Skip fan attributes if fan is not present */ |