diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2005-12-06 18:33:15 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-01-06 01:16:24 -0500 |
commit | de59cf9ed44f64991e52a9de6094729537f0420c (patch) | |
tree | 038f6fb83228d09812f729d19fb7bdc8a324dd55 /include/linux | |
parent | e1c489b0e4fbb1687f8227fe78b4769c123768c1 (diff) |
[PATCH] I2C: Make i2c_add_driver automatically set the proper module owner
This prevents i2c drivers from messing up and forgetting to set the
module owner of their driver. It also reduces the size of their drivers
by one line :)
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/i2c.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 75aa18e865da..7863a59bd598 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -291,9 +291,14 @@ struct i2c_client_address_data { | |||
291 | extern int i2c_add_adapter(struct i2c_adapter *); | 291 | extern int i2c_add_adapter(struct i2c_adapter *); |
292 | extern int i2c_del_adapter(struct i2c_adapter *); | 292 | extern int i2c_del_adapter(struct i2c_adapter *); |
293 | 293 | ||
294 | extern int i2c_add_driver(struct i2c_driver *); | 294 | extern int i2c_register_driver(struct module *, struct i2c_driver *); |
295 | extern int i2c_del_driver(struct i2c_driver *); | 295 | extern int i2c_del_driver(struct i2c_driver *); |
296 | 296 | ||
297 | static inline int i2c_add_driver(struct i2c_driver *driver) | ||
298 | { | ||
299 | return i2c_register_driver(THIS_MODULE, driver); | ||
300 | } | ||
301 | |||
297 | extern int i2c_attach_client(struct i2c_client *); | 302 | extern int i2c_attach_client(struct i2c_client *); |
298 | extern int i2c_detach_client(struct i2c_client *); | 303 | extern int i2c_detach_client(struct i2c_client *); |
299 | 304 | ||