diff options
author | bgardner@wabtec.com <bgardner@wabtec.com> | 2005-07-27 13:43:03 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-09-05 12:14:05 -0400 |
commit | a61fc683ae1b7871d8d81ac5025af1a923731547 (patch) | |
tree | 8b141faa2d84653075b6baea18e64e7302345cbd /include | |
parent | 5033017c2678df9dc75be0139f19701ff224a498 (diff) |
[PATCH] I2C: add kobj_to_i2c_client
Move the inline function kobj_to_i2c_client() from max6875.c to i2c.h.
Signed-off-by: Ben Gardner <bgardner@wabtec.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/i2c.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index be837b13f297..017445943816 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -160,6 +160,11 @@ struct i2c_client { | |||
160 | }; | 160 | }; |
161 | #define to_i2c_client(d) container_of(d, struct i2c_client, dev) | 161 | #define to_i2c_client(d) container_of(d, struct i2c_client, dev) |
162 | 162 | ||
163 | static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj) | ||
164 | { | ||
165 | return to_i2c_client(container_of(kobj, struct device, kobj)); | ||
166 | } | ||
167 | |||
163 | static inline void *i2c_get_clientdata (struct i2c_client *dev) | 168 | static inline void *i2c_get_clientdata (struct i2c_client *dev) |
164 | { | 169 | { |
165 | return dev_get_drvdata (&dev->dev); | 170 | return dev_get_drvdata (&dev->dev); |