aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/i2c.h
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2005-12-06 18:33:15 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-01-06 01:16:24 -0500
commitde59cf9ed44f64991e52a9de6094729537f0420c (patch)
tree038f6fb83228d09812f729d19fb7bdc8a324dd55 /include/linux/i2c.h
parente1c489b0e4fbb1687f8227fe78b4769c123768c1 (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/i2c.h')
-rw-r--r--include/linux/i2c.h7
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 {
291extern int i2c_add_adapter(struct i2c_adapter *); 291extern int i2c_add_adapter(struct i2c_adapter *);
292extern int i2c_del_adapter(struct i2c_adapter *); 292extern int i2c_del_adapter(struct i2c_adapter *);
293 293
294extern int i2c_add_driver(struct i2c_driver *); 294extern int i2c_register_driver(struct module *, struct i2c_driver *);
295extern int i2c_del_driver(struct i2c_driver *); 295extern int i2c_del_driver(struct i2c_driver *);
296 296
297static inline int i2c_add_driver(struct i2c_driver *driver)
298{
299 return i2c_register_driver(THIS_MODULE, driver);
300}
301
297extern int i2c_attach_client(struct i2c_client *); 302extern int i2c_attach_client(struct i2c_client *);
298extern int i2c_detach_client(struct i2c_client *); 303extern int i2c_detach_client(struct i2c_client *);
299 304