From: bgardner@wabtec.com Date: Wed, 27 Jul 2005 17:43:03 +0000 (-0500) Subject: [PATCH] I2C: add kobj_to_i2c_client X-Git-Tag: v2.6.14-rc1~752^2~62 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=a61fc683ae1b7871d8d81ac5025af1a923731547;p=linux-2.6-omap-h63xx.git [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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/i2c/chips/max6875.c b/drivers/i2c/chips/max6875.c index 1a7993e6354..35a8e921529 100644 --- a/drivers/i2c/chips/max6875.c +++ b/drivers/i2c/chips/max6875.c @@ -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) { diff --git a/include/linux/i2c.h b/include/linux/i2c.h index be837b13f29..01744594381 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -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);