misc: apds990x, bh1770glc, lis3lv02d: use to_i2c_client
Use to_i2c_client() instead of open-coding it. Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
50e6315dba
commit
8c99d8e6de
@@ -1323,7 +1323,7 @@ static int bh1770_remove(struct i2c_client *client)
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int bh1770_suspend(struct device *dev)
|
||||
{
|
||||
struct i2c_client *client = container_of(dev, struct i2c_client, dev);
|
||||
struct i2c_client *client = to_i2c_client(dev);
|
||||
struct bh1770_chip *chip = i2c_get_clientdata(client);
|
||||
|
||||
bh1770_chip_off(chip);
|
||||
@@ -1333,7 +1333,7 @@ static int bh1770_suspend(struct device *dev)
|
||||
|
||||
static int bh1770_resume(struct device *dev)
|
||||
{
|
||||
struct i2c_client *client = container_of(dev, struct i2c_client, dev);
|
||||
struct i2c_client *client = to_i2c_client(dev);
|
||||
struct bh1770_chip *chip = i2c_get_clientdata(client);
|
||||
int ret = 0;
|
||||
|
||||
@@ -1361,7 +1361,7 @@ static int bh1770_resume(struct device *dev)
|
||||
#ifdef CONFIG_PM
|
||||
static int bh1770_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct i2c_client *client = container_of(dev, struct i2c_client, dev);
|
||||
struct i2c_client *client = to_i2c_client(dev);
|
||||
struct bh1770_chip *chip = i2c_get_clientdata(client);
|
||||
|
||||
bh1770_chip_off(chip);
|
||||
@@ -1371,7 +1371,7 @@ static int bh1770_runtime_suspend(struct device *dev)
|
||||
|
||||
static int bh1770_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct i2c_client *client = container_of(dev, struct i2c_client, dev);
|
||||
struct i2c_client *client = to_i2c_client(dev);
|
||||
struct bh1770_chip *chip = i2c_get_clientdata(client);
|
||||
|
||||
bh1770_chip_on(chip);
|
||||
|
Reference in New Issue
Block a user