Skip to contentSkip to conversation

I2C: add kobj_to_i2c_client

PATCH New Greg KH 1 participant 1 message Sep 5, 2005 I2C

lore
Share & tools
lore

Greg KH

author
#0 lore raw

PATCH 1/1 I2C: add kobj_to_i2c_client

[PATCH] I2C: add kobj_to_i2c_client

Move the inline function kobj_to_i2c_client() from max6875.c to i2c.h.

---
commit a61fc683ae1b7871d8d81ac5025af1a923731547
tree 8b141faa2d84653075b6baea18e64e7302345cbd
parent 5033017c2678df9dc75be0139f19701ff224a498
author [email protected] <[email protected]> Wed, 27 Jul 2005 12:43:03 -0500 committer Greg Kroah-Hartman <[email protected]> Mon, 05 Sep 2005 09:14:05 -0700

 drivers/i2c/chips/max6875.c |    5 -----
 include/linux/i2c.h         |    5 +++++
 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/i2c/chips/max6875.c +0 -5
@@ -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)
 {
include/linux/i2c.h +5 -0
@@ -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);