[PATCH] Fix compilation issues in nouveau_pm when CONFIG_HWMON is not set

Martin Peres martin.peres at ensi-bourges.fr
Tue Oct 26 03:48:28 PDT 2010


Signed-off-by: Martin Peres <martin.peres at ensi-bourges.fr>
---
 drivers/gpu/drm/nouveau/nouveau_pm.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_pm.c b/drivers/gpu/drm/nouveau/nouveau_pm.c
index 8ef1d5b..f691661 100644
--- a/drivers/gpu/drm/nouveau/nouveau_pm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_pm.c
@@ -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


--------------000303090505000403050303--


More information about the dri-devel mailing list