Skip to content

Commit

Permalink
[PATCH] I2C: add kobj_to_i2c_client
Browse files Browse the repository at this point in the history
Move the inline function kobj_to_i2c_client() from max6875.c to i2c.h.

Signed-off-by: Ben Gardner <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
[email protected] authored and gregkh committed Sep 5, 2005
1 parent 5033017 commit a61fc68
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 0 additions & 5 deletions drivers/i2c/chips/max6875.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
5 changes: 5 additions & 0 deletions include/linux/i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a61fc68

Please sign in to comment.