diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2005-12-07 02:33:15 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-01-06 09:16:24 +0300 |
commit | de59cf9ed44f64991e52a9de6094729537f0420c (patch) | |
tree | 038f6fb83228d09812f729d19fb7bdc8a324dd55 /include/linux/i2c.h | |
parent | e1c489b0e4fbb1687f8227fe78b4769c123768c1 (diff) | |
download | linux-de59cf9ed44f64991e52a9de6094729537f0420c.tar.xz |
[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/i2c.h')
-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 { extern int i2c_add_adapter(struct i2c_adapter *); extern int i2c_del_adapter(struct i2c_adapter *); -extern int i2c_add_driver(struct i2c_driver *); +extern int i2c_register_driver(struct module *, struct i2c_driver *); extern int i2c_del_driver(struct i2c_driver *); +static inline int i2c_add_driver(struct i2c_driver *driver) +{ + return i2c_register_driver(THIS_MODULE, driver); +} + extern int i2c_attach_client(struct i2c_client *); extern int i2c_detach_client(struct i2c_client *); |