summaryrefslogtreecommitdiffstats
path: root/drivers/misc/bh1770glc.c
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@163.com>2015-12-28 16:00:16 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-08 08:01:45 +0100
commit8c99d8e6de0474bf5a7004e41c044ac4dcacbae1 (patch)
tree63873c53965a2c89e325277839fbcb95bc4c0ced /drivers/misc/bh1770glc.c
parentmisc/bmp085: Enable building as a module (diff)
downloadlinux-8c99d8e6de0474bf5a7004e41c044ac4dcacbae1.tar.xz
linux-8c99d8e6de0474bf5a7004e41c044ac4dcacbae1.zip
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>
Diffstat (limited to 'drivers/misc/bh1770glc.c')
-rw-r--r--drivers/misc/bh1770glc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/misc/bh1770glc.c b/drivers/misc/bh1770glc.c
index 753d7ecdadaa..845466e45b95 100644
--- a/drivers/misc/bh1770glc.c
+++ b/drivers/misc/bh1770glc.c
@@ -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);