summaryrefslogtreecommitdiff
path: root/include/linux/i2c.h
diff options
context:
space:
mode:
authorPaul Gortmaker <paul.gortmaker@windriver.com>2011-05-27 17:02:11 +0400
committerPaul Gortmaker <paul.gortmaker@windriver.com>2011-11-01 03:32:32 +0400
commiteb5589a8f0dab7e29021344228856339e6a1249c (patch)
treed83790e5ac7feacba5b1832fbe7f8d2a39d76f65 /include/linux/i2c.h
parent7c926402a7e8c9b279968fd94efec8700ba3859e (diff)
downloadlinux-eb5589a8f0dab7e29021344228856339e6a1249c.tar.xz
include: convert various register fcns to macros to avoid include chaining
The original implementations reference THIS_MODULE in an inline. We could include <linux/export.h>, but it is better to avoid chaining. Fortunately someone else already thought of this, and made a similar inline into a #define in <linux/device.h> for device_schedule_callback(), [see commit 523ded71de0] so follow that precedent here. Also bubble up any __must_check that were used on the prev. wrapper inline functions up one to the real __register functions, to preserve any prev. sanity checks that were used in those instances. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'include/linux/i2c.h')
-rw-r--r--include/linux/i2c.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 38a21c3edd2c..1be303bfc254 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -451,10 +451,9 @@ extern int i2c_add_numbered_adapter(struct i2c_adapter *);
extern int i2c_register_driver(struct module *, struct i2c_driver *);
extern void i2c_del_driver(struct i2c_driver *);
-static inline int i2c_add_driver(struct i2c_driver *driver)
-{
- return i2c_register_driver(THIS_MODULE, driver);
-}
+/* use a define to avoid include chaining to get THIS_MODULE */
+#define i2c_add_driver(driver) \
+ i2c_register_driver(THIS_MODULE, driver)
extern struct i2c_client *i2c_use_client(struct i2c_client *client);
extern void i2c_release_client(struct i2c_client *client);