diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_pm.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_pm.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_pm.c b/drivers/gpu/drm/nouveau/nouveau_pm.c index 1c99c55d6d46..9f7b158f5825 100644 --- a/drivers/gpu/drm/nouveau/nouveau_pm.c +++ b/drivers/gpu/drm/nouveau/nouveau_pm.c | |||
@@ -284,6 +284,7 @@ nouveau_sysfs_fini(struct drm_device *dev) | |||
284 | } | 284 | } |
285 | } | 285 | } |
286 | 286 | ||
287 | #ifdef CONFIG_HWMON | ||
287 | static ssize_t | 288 | static ssize_t |
288 | nouveau_hwmon_show_temp(struct device *d, struct device_attribute *a, char *buf) | 289 | nouveau_hwmon_show_temp(struct device *d, struct device_attribute *a, char *buf) |
289 | { | 290 | { |
@@ -395,10 +396,12 @@ static struct attribute *hwmon_attributes[] = { | |||
395 | static const struct attribute_group hwmon_attrgroup = { | 396 | static const struct attribute_group hwmon_attrgroup = { |
396 | .attrs = hwmon_attributes, | 397 | .attrs = hwmon_attributes, |
397 | }; | 398 | }; |
399 | #endif | ||
398 | 400 | ||
399 | static int | 401 | static int |
400 | nouveau_hwmon_init(struct drm_device *dev) | 402 | nouveau_hwmon_init(struct drm_device *dev) |
401 | { | 403 | { |
404 | #ifdef CONFIG_HWMON | ||
402 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 405 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
403 | struct nouveau_pm_engine *pm = &dev_priv->engine.pm; | 406 | struct nouveau_pm_engine *pm = &dev_priv->engine.pm; |
404 | struct device *hwmon_dev; | 407 | struct device *hwmon_dev; |
@@ -425,13 +428,14 @@ nouveau_hwmon_init(struct drm_device *dev) | |||
425 | } | 428 | } |
426 | 429 | ||
427 | pm->hwmon = hwmon_dev; | 430 | pm->hwmon = hwmon_dev; |
428 | 431 | #endif | |
429 | return 0; | 432 | return 0; |
430 | } | 433 | } |
431 | 434 | ||
432 | static void | 435 | static void |
433 | nouveau_hwmon_fini(struct drm_device *dev) | 436 | nouveau_hwmon_fini(struct drm_device *dev) |
434 | { | 437 | { |
438 | #ifdef CONFIG_HWMON | ||
435 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 439 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
436 | struct nouveau_pm_engine *pm = &dev_priv->engine.pm; | 440 | struct nouveau_pm_engine *pm = &dev_priv->engine.pm; |
437 | 441 | ||
@@ -439,6 +443,7 @@ nouveau_hwmon_fini(struct drm_device *dev) | |||
439 | sysfs_remove_group(&pm->hwmon->kobj, &hwmon_attrgroup); | 443 | sysfs_remove_group(&pm->hwmon->kobj, &hwmon_attrgroup); |
440 | hwmon_device_unregister(pm->hwmon); | 444 | hwmon_device_unregister(pm->hwmon); |
441 | } | 445 | } |
446 | #endif | ||
442 | } | 447 | } |
443 | 448 | ||
444 | int | 449 | int |