Le 11/10/2010 18:29, Randy Dunlap a écrit :
When CONFIG_HWMON is not enabled:
drivers/built-in.o: In function `nouveau_pm_fini':
(.text+0x1c680f): undefined reference to `hwmon_device_unregister'
drivers/built-in.o: In function `nouveau_hwmon_init':
nouveau_pm.c:(.text+0x1c6f93): undefined reference to `hwmon_device_register'
nouveau_pm.c:(.text+0x1c7094): undefined reference to `hwmon_device_unregister
Hi,
I cannot test the attached patch as my kernel forces me to compile hwmon
(static or module). What kernel version are you using?
As nouveau, radeon doesn't check for CONFIG_HWMON, you may want to ask
them to do so.
Cheers,
Martin
>From 77aee56418ffbb4f0d4683d9e6d9d8d46ad12621 Mon Sep 17 00:00:00 2001
From: Martin Peres <martin.peres@xxxxxxxxxxxxxxx>
Date: Tue, 12 Oct 2010 03:30:27 +0200
Subject: [PATCH] Try to fix issues when compiling nouveau without CONFIG_HWMON
Signed-off: Martin Peres <martin.peres@xxxxxxxxxxxxxxx>
---
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
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel