]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mfd: Use to_i2c_client() instead of open-coding it
authorGeliang Tang <geliangtang@163.com>
Mon, 28 Dec 2015 15:00:14 +0000 (23:00 +0800)
committerLee Jones <lee.jones@linaro.org>
Thu, 14 Jan 2016 08:43:50 +0000 (08:43 +0000)
Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/88pm80x.c
drivers/mfd/88pm860x-core.c
drivers/mfd/max14577.c
drivers/mfd/max77686.c
drivers/mfd/max77693.c
drivers/mfd/max77843.c
drivers/mfd/max8925-i2c.c
drivers/mfd/max8997.c
drivers/mfd/max8998.c
drivers/mfd/sec-core.c

index 63445ea6b0bfe2481c681e657d1b16d0abd7fea3..3f24ecbe2576d16b5ed36e5e51d33ea88821f8dc 100644 (file)
@@ -135,7 +135,7 @@ EXPORT_SYMBOL_GPL(pm80x_deinit);
 #ifdef CONFIG_PM_SLEEP
 static int pm80x_suspend(struct device *dev)
 {
-       struct i2c_client *client = container_of(dev, struct i2c_client, dev);
+       struct i2c_client *client = to_i2c_client(dev);
        struct pm80x_chip *chip = i2c_get_clientdata(client);
 
        if (chip && chip->wu_flag)
@@ -147,7 +147,7 @@ static int pm80x_suspend(struct device *dev)
 
 static int pm80x_resume(struct device *dev)
 {
-       struct i2c_client *client = container_of(dev, struct i2c_client, dev);
+       struct i2c_client *client = to_i2c_client(dev);
        struct pm80x_chip *chip = i2c_get_clientdata(client);
 
        if (chip && chip->wu_flag)
index 3269a9990b2422cfa05de0aa30dd163fc1b5f397..e497cee36066b09e72718f1a7f10dbeafdf76cae 100644 (file)
@@ -1218,7 +1218,7 @@ static int pm860x_remove(struct i2c_client *client)
 #ifdef CONFIG_PM_SLEEP
 static int pm860x_suspend(struct device *dev)
 {
-       struct i2c_client *client = container_of(dev, struct i2c_client, dev);
+       struct i2c_client *client = to_i2c_client(dev);
        struct pm860x_chip *chip = i2c_get_clientdata(client);
 
        if (device_may_wakeup(dev) && chip->wakeup_flag)
@@ -1228,7 +1228,7 @@ static int pm860x_suspend(struct device *dev)
 
 static int pm860x_resume(struct device *dev)
 {
-       struct i2c_client *client = container_of(dev, struct i2c_client, dev);
+       struct i2c_client *client = to_i2c_client(dev);
        struct pm860x_chip *chip = i2c_get_clientdata(client);
 
        if (device_may_wakeup(dev) && chip->wakeup_flag)
index 56e216dedc9167c830afca93bf0b6555472be7dd..2280b3fdcf6812c21348cba4f2b4e9ad8606afd9 100644 (file)
@@ -495,7 +495,7 @@ MODULE_DEVICE_TABLE(i2c, max14577_i2c_id);
 #ifdef CONFIG_PM_SLEEP
 static int max14577_suspend(struct device *dev)
 {
-       struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
+       struct i2c_client *i2c = to_i2c_client(dev);
        struct max14577 *max14577 = i2c_get_clientdata(i2c);
 
        if (device_may_wakeup(dev))
@@ -516,7 +516,7 @@ static int max14577_suspend(struct device *dev)
 
 static int max14577_resume(struct device *dev)
 {
-       struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
+       struct i2c_client *i2c = to_i2c_client(dev);
        struct max14577 *max14577 = i2c_get_clientdata(i2c);
 
        if (device_may_wakeup(dev))
index d19be64cd32bff6de5c23484c92e5c959c5cd297..d959ebbb2194aa29147d1201eb5e61b7d734b68c 100644 (file)
@@ -352,7 +352,7 @@ MODULE_DEVICE_TABLE(i2c, max77686_i2c_id);
 #ifdef CONFIG_PM_SLEEP
 static int max77686_suspend(struct device *dev)
 {
-       struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
+       struct i2c_client *i2c = to_i2c_client(dev);
        struct max77686_dev *max77686 = i2c_get_clientdata(i2c);
 
        if (device_may_wakeup(dev))
@@ -374,7 +374,7 @@ static int max77686_suspend(struct device *dev)
 
 static int max77686_resume(struct device *dev)
 {
-       struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
+       struct i2c_client *i2c = to_i2c_client(dev);
        struct max77686_dev *max77686 = i2c_get_clientdata(i2c);
 
        if (device_may_wakeup(dev))
index 007f729e150b0c191d8d796fc6e6edb923d7a6e3..b83b7a7da1ae0021acbcffccedcf5bf169c2a02e 100644 (file)
@@ -334,7 +334,7 @@ MODULE_DEVICE_TABLE(i2c, max77693_i2c_id);
 
 static int max77693_suspend(struct device *dev)
 {
-       struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
+       struct i2c_client *i2c = to_i2c_client(dev);
        struct max77693_dev *max77693 = i2c_get_clientdata(i2c);
 
        if (device_may_wakeup(dev)) {
@@ -347,7 +347,7 @@ static int max77693_suspend(struct device *dev)
 
 static int max77693_resume(struct device *dev)
 {
-       struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
+       struct i2c_client *i2c = to_i2c_client(dev);
        struct max77693_dev *max77693 = i2c_get_clientdata(i2c);
 
        if (device_may_wakeup(dev)) {
index 586098f1b233a6d19da9e74e1d2dd2e396408635..7cfc95b49c5d529146db2d984dd33605229318d7 100644 (file)
@@ -197,7 +197,7 @@ MODULE_DEVICE_TABLE(i2c, max77843_id);
 
 static int __maybe_unused max77843_suspend(struct device *dev)
 {
-       struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
+       struct i2c_client *i2c = to_i2c_client(dev);
        struct max77693_dev *max77843 = i2c_get_clientdata(i2c);
 
        disable_irq(max77843->irq);
@@ -209,7 +209,7 @@ static int __maybe_unused max77843_suspend(struct device *dev)
 
 static int __maybe_unused max77843_resume(struct device *dev)
 {
-       struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
+       struct i2c_client *i2c = to_i2c_client(dev);
        struct max77693_dev *max77843 = i2c_get_clientdata(i2c);
 
        if (device_may_wakeup(dev))
index b0fe8103e401e66e10629d462733790d44c5bd5a..70443b161a5bb3c67b151569c828711196b5b435 100644 (file)
@@ -215,7 +215,7 @@ static int max8925_remove(struct i2c_client *client)
 #ifdef CONFIG_PM_SLEEP
 static int max8925_suspend(struct device *dev)
 {
-       struct i2c_client *client = container_of(dev, struct i2c_client, dev);
+       struct i2c_client *client = to_i2c_client(dev);
        struct max8925_chip *chip = i2c_get_clientdata(client);
 
        if (device_may_wakeup(dev) && chip->wakeup_flag)
@@ -225,7 +225,7 @@ static int max8925_suspend(struct device *dev)
 
 static int max8925_resume(struct device *dev)
 {
-       struct i2c_client *client = container_of(dev, struct i2c_client, dev);
+       struct i2c_client *client = to_i2c_client(dev);
        struct max8925_chip *chip = i2c_get_clientdata(client);
 
        if (device_may_wakeup(dev) && chip->wakeup_flag)
index 156ed6f92aa32fffca7ce9d39ff494d0a0487cd0..f316348e3d9814618aaab09a82e33c162abf5dd8 100644 (file)
@@ -437,7 +437,7 @@ static u8 max8997_dumpaddr_haptic[] = {
 
 static int max8997_freeze(struct device *dev)
 {
-       struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
+       struct i2c_client *i2c = to_i2c_client(dev);
        struct max8997_dev *max8997 = i2c_get_clientdata(i2c);
        int i;
 
@@ -459,7 +459,7 @@ static int max8997_freeze(struct device *dev)
 
 static int max8997_restore(struct device *dev)
 {
-       struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
+       struct i2c_client *i2c = to_i2c_client(dev);
        struct max8997_dev *max8997 = i2c_get_clientdata(i2c);
        int i;
 
@@ -481,7 +481,7 @@ static int max8997_restore(struct device *dev)
 
 static int max8997_suspend(struct device *dev)
 {
-       struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
+       struct i2c_client *i2c = to_i2c_client(dev);
        struct max8997_dev *max8997 = i2c_get_clientdata(i2c);
 
        if (device_may_wakeup(dev))
@@ -491,7 +491,7 @@ static int max8997_suspend(struct device *dev)
 
 static int max8997_resume(struct device *dev)
 {
-       struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
+       struct i2c_client *i2c = to_i2c_client(dev);
        struct max8997_dev *max8997 = i2c_get_clientdata(i2c);
 
        if (device_may_wakeup(dev))
index a7afe3bf27fc7d93b65842e825a340aeb8a8f2a2..ab28b29400f65b62095c67d9accdeaca818bb0c6 100644 (file)
@@ -274,7 +274,7 @@ MODULE_DEVICE_TABLE(i2c, max8998_i2c_id);
 
 static int max8998_suspend(struct device *dev)
 {
-       struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
+       struct i2c_client *i2c = to_i2c_client(dev);
        struct max8998_dev *max8998 = i2c_get_clientdata(i2c);
 
        if (device_may_wakeup(dev))
@@ -284,7 +284,7 @@ static int max8998_suspend(struct device *dev)
 
 static int max8998_resume(struct device *dev)
 {
-       struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
+       struct i2c_client *i2c = to_i2c_client(dev);
        struct max8998_dev *max8998 = i2c_get_clientdata(i2c);
 
        if (device_may_wakeup(dev))
@@ -344,7 +344,7 @@ static struct max8998_reg_dump max8998_dump[] = {
 /* Save registers before hibernation */
 static int max8998_freeze(struct device *dev)
 {
-       struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
+       struct i2c_client *i2c = to_i2c_client(dev);
        int i;
 
        for (i = 0; i < ARRAY_SIZE(max8998_dump); i++)
@@ -357,7 +357,7 @@ static int max8998_freeze(struct device *dev)
 /* Restore registers after hibernation */
 static int max8998_restore(struct device *dev)
 {
-       struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
+       struct i2c_client *i2c = to_i2c_client(dev);
        int i;
 
        for (i = 0; i < ARRAY_SIZE(max8998_dump); i++)
index c9802ba9be7216dd48e1c37c2430ef64d17a0654..400e1d7d8d08fb94086de003eb1346c1bbba4139 100644 (file)
@@ -536,7 +536,7 @@ static void sec_pmic_shutdown(struct i2c_client *i2c)
 #ifdef CONFIG_PM_SLEEP
 static int sec_pmic_suspend(struct device *dev)
 {
-       struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
+       struct i2c_client *i2c = to_i2c_client(dev);
        struct sec_pmic_dev *sec_pmic = i2c_get_clientdata(i2c);
 
        if (device_may_wakeup(dev))
@@ -557,7 +557,7 @@ static int sec_pmic_suspend(struct device *dev)
 
 static int sec_pmic_resume(struct device *dev)
 {
-       struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
+       struct i2c_client *i2c = to_i2c_client(dev);
        struct sec_pmic_dev *sec_pmic = i2c_get_clientdata(i2c);
 
        if (device_may_wakeup(dev))