From 4f4af7ac5be0f418a3c0cbca1b44ab4f93216060 Mon Sep 17 00:00:00 2001
From: Martin Peres <martin.peres@ensi-bourges.fr>
Date: Tue, 26 Oct 2010 12:48:28 +0200
Subject: [PATCH] Fix compilation issues in nouveau_pm when CONFIG_HWMON is not set
Signed-off-by: Martin Peres <martin.peres@ensi-bourges.fr>
---
drivers/gpu/drm/nouveau/nouveau_pm.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
@@ -405,12 +405,15 @@ nouveau_hwmon_init(struct drm_device *dev)
{
struct drm_nouveau_private *dev_priv = dev->dev_private;
struct nouveau_pm_engine *pm = &dev_priv->engine.pm;
+#ifdef CONFIG_HWMON
struct device *hwmon_dev;
int ret;
+#endif
if (!pm->temp_get)
return -ENODEV;
+#ifdef CONFIG_HWMON
hwmon_dev = hwmon_device_register(&dev->pdev->dev);
if (IS_ERR(hwmon_dev)) {
ret = PTR_ERR(hwmon_dev);
@@ -429,6 +432,9 @@ nouveau_hwmon_init(struct drm_device *dev)
}
pm->hwmon = hwmon_dev;
+#else
+ pm->hwmon = NULL;
+#endif
return 0;
}
@@ -436,6 +442,7 @@ nouveau_hwmon_init(struct drm_device *dev)
static void
nouveau_hwmon_fini(struct drm_device *dev)
{
+#ifdef CONFIG_HWMON
struct drm_nouveau_private *dev_priv = dev->dev_private;
struct nouveau_pm_engine *pm = &dev_priv->engine.pm;
@@ -443,6 +450,7 @@ nouveau_hwmon_fini(struct drm_device *dev)
sysfs_remove_group(&pm->hwmon->kobj, &hwmon_attrgroup);
hwmon_device_unregister(pm->hwmon);
}
+#endif
}
#ifdef CONFIG_ACPI
--
1.7.3.2