[PATCH] I2C: add kobj_to_i2c_client
authorbgardner@wabtec.com <bgardner@wabtec.com>
Wed, 27 Jul 2005 17:43:03 +0000 (12:43 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Sep 2005 16:14:05 +0000 (09:14 -0700)
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>
drivers/i2c/chips/max6875.c
include/linux/i2c.h

index 1a7993e63541a8b738d50f77a9f8aa3d6a94c88a..35a8e92152948b51d99abc0ea65607864b8ef3df 100644 (file)
@@ -131,11 +131,6 @@ exit_up:
        up(&data->update_lock);
 }
 
-static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj)
-{
-       return to_i2c_client(container_of(kobj, struct device, kobj));
-}
-
 static ssize_t max6875_read(struct kobject *kobj, char *buf, loff_t off,
                            size_t count)
 {
index be837b13f2978d027156ee7459c8453da6cdee15..017445943816ea329b5ce8b86704e801f18bb490 100644 (file)
@@ -160,6 +160,11 @@ struct i2c_client {
 };
 #define to_i2c_client(d) container_of(d, struct i2c_client, dev)
 
+static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj)
+{
+       return to_i2c_client(container_of(kobj, struct device, kobj));
+}
+
 static inline void *i2c_get_clientdata (struct i2c_client *dev)
 {
        return dev_get_drvdata (&dev->dev);