[POWERPC] therm_windtunnel: Eliminate some build warnings

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Wednesday, January 30, 2008 - 8:03 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=98894d...
Commit:     98894dffaf11981ac9dc33c818ecafcb02a5439b
Parent:     85e99b9fffb62e101e38c74c935256fc589703c2
Author:     Stephen Rothwell <sfr@canb.auug.org.au>
AuthorDate: Thu Jan 3 15:15:28 2008 +1100
Committer:  Paul Mackerras <paulus@samba.org>
CommitDate: Thu Jan 17 14:57:27 2008 +1100

    [POWERPC] therm_windtunnel: Eliminate some build warnings
    
    We don't care if the device_create_file calls fail, the driver will work
    just as well without them, so just issue a runtime warning.
    
    drivers/macintosh/therm_windtunnel.c: In function 'setup_hardware':
    drivers/macintosh/therm_windtunnel.c:268: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
    drivers/macintosh/therm_windtunnel.c:269: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
    
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    Signed-off-by: Paul Mackerras <paulus@samba.org>
---
 drivers/macintosh/therm_windtunnel.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/macintosh/therm_windtunnel.c b/drivers/macintosh/therm_windtunnel.c
index 3722402..63ef1f6 100644
--- a/drivers/macintosh/therm_windtunnel.c
+++ b/drivers/macintosh/therm_windtunnel.c
@@ -223,6 +223,7 @@ static void
 setup_hardware( void )
 {
 	int val;
+	int err;
 
 	/* save registers (if we unload the module) */
 	x.r0 = read_reg( x.fan, 0x00, 1 );
@@ -265,8 +266,11 @@ setup_hardware( void )
 	x.upind = -1;
 	/* tune_fan( fan_up_table[x.upind].fan_setting ); */
 
-	device_create_file( &x.of_dev->dev, &dev_attr_cpu_temperature );
-	device_create_file( &x.of_dev->dev, &dev_attr_case_temperature );
+	err = device_create_file( &x.of_dev->dev, &dev_attr_cpu_temperature );
+	err |= device_create_file( &x.of_dev->dev, &dev_attr_case_temperature );
+	if (err)
+		printk(KERN_WARNING
+			"Failed to create temperature attribute file(s).\n");
 }
 
 static void
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[POWERPC] therm_windtunnel: Eliminate some build warnings, Linux Kernel Mailing ..., (Wed Jan 30, 8:03 pm)