diff mbox

linux-next: Tree for Nov 21 (nouveau)

Message ID 20131122113748.GB20300@shodan (mailing list archive)
State New, archived
Headers show

Commit Message

Adrian Pop Nov. 22, 2013, 11:37 a.m. UTC
Hello!

> on x86_64:
> 
> CONFIG_HWMON is not enabled.
> 
> drivers/gpu/drm/nouveau/nouveau_hwmon.c: In function 'nouveau_hwmon_init':
> drivers/gpu/drm/nouveau/nouveau_hwmon.c:633:2: error: 'hwmon' undeclared (first use in this function)

I've attached a patch that fixes the build for me when using this
config.

Comments

Randy Dunlap Nov. 22, 2013, 7:22 p.m. UTC | #1
On 11/22/13 03:37, Adrian Pop wrote:
> Hello!
> 
>> on x86_64:
>>
>> CONFIG_HWMON is not enabled.
>>
>> drivers/gpu/drm/nouveau/nouveau_hwmon.c: In function 'nouveau_hwmon_init':
>> drivers/gpu/drm/nouveau/nouveau_hwmon.c:633:2: error: 'hwmon' undeclared (first use in this function)
> 
> I've attached a patch that fixes the build for me when using this
> config.
> 

That works.  Thanks.

Acked-by: Randy Dunlap <rdunlap@infradead.org>
diff mbox

Patch

From: Adrian Pop <sultryweather@gmail.com>
Date: Fri, 22 Nov 2013 12:52:19 +0200
Subject: [PATCH] nouveau: Fixed the 'hwmon' undeclared build error

hwmon is declared inside the #if defined(CONFIG_HWMON)... but is still
referenced outside of it, which results in a build error. By removing
the reference, Linux builds successfully with both code paths.
Two warnings from running checkpatch.pl have been fixed too.

Signed-off-by: Adrian Pop <sultryweather@gmail.com>
---
 drivers/gpu/drm/nouveau/nouveau_hwmon.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_hwmon.c b/drivers/gpu/drm/nouveau/nouveau_hwmon.c
index 38a4db5..21fc8d6 100644
--- a/drivers/gpu/drm/nouveau/nouveau_hwmon.c
+++ b/drivers/gpu/drm/nouveau/nouveau_hwmon.c
@@ -357,7 +357,7 @@  nouveau_hwmon_show_fan1_input(struct device *d, struct device_attribute *attr,
 static SENSOR_DEVICE_ATTR(fan1_input, S_IRUGO, nouveau_hwmon_show_fan1_input,
 			  NULL, 0);
 
- static ssize_t
+static ssize_t
 nouveau_hwmon_get_pwm1_enable(struct device *d,
 			   struct device_attribute *a, char *buf)
 {
@@ -383,7 +383,7 @@  nouveau_hwmon_set_pwm1_enable(struct device *d, struct device_attribute *a,
 	long value;
 	int ret;
 
-	if (strict_strtol(buf, 10, &value) == -EINVAL)
+	if (kstrtol(buf, 10, &value) == -EINVAL)
 		return -EINVAL;
 
 	ret = therm->attr_set(therm, NOUVEAU_THERM_ATTR_FAN_MODE, value);
@@ -630,7 +630,6 @@  error:
 	hwmon->hwmon = NULL;
 	return ret;
 #else
-	hwmon->hwmon = NULL;
 	return 0;
 #endif
 }
-- 
1.8.4.2