From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 16 Jan 2004 12:41:58 +0100 From: Colin Leroy To: linuxppc-dev@lists.linuxppc.org Cc: benh@kernel.crashing.org Subject: Re: [PATCH] therm_* drivers need i2c-keywest Message-Id: <20040116124158.24db8307.colin@colino.net> In-Reply-To: <20040116122756.034fc736.colin@colino.net> References: <20040116122756.034fc736.colin@colino.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Fri__16_Jan_2004_12_41_58_+0100_4H8mXXG=.AFnh3sj" Sender: owner-linuxppc-dev@lists.linuxppc.org List-Id: This is a multi-part message in MIME format. --Multipart_Fri__16_Jan_2004_12_41_58_+0100_4H8mXXG=.AFnh3sj Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On 16 Jan 2004 at 12h01, Colin Leroy wrote: > Hi, > > This patch lets the different pmac thermostat drivers try to load > i2c-keywest if necessary and possible. As I didn't saw that request_module() errors if the module is already loaded (heh.), a better version of this is to avoid checking return value... See attached. -- Colin --Multipart_Fri__16_Jan_2004_12_41_58_+0100_4H8mXXG=.AFnh3sj Content-Type: text/plain; name="therm_load_i2c.diff" Content-Disposition: attachment; filename="therm_load_i2c.diff" Content-Transfer-Encoding: 7bit Index: drivers/macintosh/therm_adt7467.c =================================================================== RCS file: /home/cvsroot/linuxppc/drivers/macintosh/therm_adt7467.c,v retrieving revision 1.1 diff -u -u -r1.1 therm_adt7467.c --- drivers/macintosh/therm_adt7467.c 11 Jan 2004 20:21:54 -0000 1.1 +++ drivers/macintosh/therm_adt7467.c 16 Jan 2004 11:40:08 -0000 @@ -27,6 +27,7 @@ #include #include #include +#include #undef DEBUG @@ -392,6 +393,7 @@ { struct device_node* np; u32 *prop; + int res = 0; /* Currently, we only deal with the iBook G4, we will support * all "2003" powerbooks later on @@ -424,6 +426,9 @@ device_create_file(&of_dev->dev, &dev_attr_gpu_limit); device_create_file(&of_dev->dev, &dev_attr_fan_speed); +#ifdef CONFIG_KMOD + request_module("i2c-keywest"); +#endif return i2c_add_driver(&thermostat_driver); } Index: drivers/macintosh/therm_pm72.c =================================================================== RCS file: /home/cvsroot/linuxppc/drivers/macintosh/therm_pm72.c,v retrieving revision 1.1.1.1 diff -u -u -r1.1.1.1 therm_pm72.c --- drivers/macintosh/therm_pm72.c 8 Jan 2004 11:25:19 -0000 1.1.1.1 +++ drivers/macintosh/therm_pm72.c 16 Jan 2004 11:39:56 -0000 @@ -91,6 +91,7 @@ #include #include #include +#include #include "therm_pm72.h" @@ -1165,6 +1166,9 @@ state = state_detached; +#ifdef CONFIG_KMOD + request_module("i2c-keywest"); +#endif rc = i2c_add_driver(&therm_pm72_driver); if (rc < 0) return rc; Index: drivers/macintosh/therm_windtunnel.c =================================================================== RCS file: /home/cvsroot/linuxppc/drivers/macintosh/therm_windtunnel.c,v retrieving revision 1.1 diff -u -u -r1.1 therm_windtunnel.c --- drivers/macintosh/therm_windtunnel.c 11 Jan 2004 20:21:55 -0000 1.1 +++ drivers/macintosh/therm_windtunnel.c 16 Jan 2004 11:39:35 -0000 @@ -44,6 +44,7 @@ #include #include #include +#include MODULE_AUTHOR("Samuel Rydh "); MODULE_DESCRIPTION("Apple G4 (windtunnel) fan driver"); @@ -380,6 +381,9 @@ printk(KERN_ERR "g4fan: unsupported machine type\n"); return -ENODEV; } +#ifdef CONFIG_KMOD + request_module("i2c-keywest"); +#endif if( (ret=i2c_add_driver(&g4fan_driver)) ) return ret; --Multipart_Fri__16_Jan_2004_12_41_58_+0100_4H8mXXG=.AFnh3sj-- ** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/