[PATCH] Try to fix issues when compiling nouveau without CONFIG_HWMON Signed-off: Martin Peres <martin.peres at ensi-bourges.fr>
Martin Peres
martin.peres at ensi-bourges.fr
Mon Oct 11 18:30:27 PDT 2010
---
drivers/gpu/drm/nouveau/nouveau_pm.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_pm.c b/drivers/gpu/drm/nouveau/nouveau_pm.c
index 1c99c55..74a7d3a 100644
--- a/drivers/gpu/drm/nouveau/nouveau_pm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_pm.c
@@ -27,8 +27,10 @@
#include "nouveau_drv.h"
#include "nouveau_pm.h"
+#ifdef CONFIG_HWMON
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
+#endif
static int
nouveau_pm_clock_set(struct drm_device *dev, struct nouveau_pm_level *perflvl,
@@ -406,7 +408,8 @@ nouveau_hwmon_init(struct drm_device *dev)
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);
@@ -425,6 +428,9 @@ nouveau_hwmon_init(struct drm_device *dev)
}
pm->hwmon = hwmon_dev;
+#else
+ pm->hwmon = NULL;
+#endif
return 0;
}
@@ -435,10 +441,12 @@ nouveau_hwmon_fini(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
if (pm->hwmon) {
sysfs_remove_group(&pm->hwmon->kobj, &hwmon_attrgroup);
hwmon_device_unregister(pm->hwmon);
}
+#endif
}
int
--
1.7.3.1
--------------070200030803040901060103--
More information about the dri-devel
mailing list