提交 a61fc683 编写于 作者: B bgardner@wabtec.com 提交者: Greg Kroah-Hartman

[PATCH] I2C: add kobj_to_i2c_client

Move the inline function kobj_to_i2c_client() from max6875.c to i2c.h.
Signed-off-by: NBen Gardner <bgardner@wabtec.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 5033017c
......@@ -131,11 +131,6 @@ static void max6875_update_slice(struct i2c_client *client, int slice)
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)
{
......
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册