aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@163.com>2015-12-28 10:00:14 -0500
committerLee Jones <lee.jones@linaro.org>2016-01-14 03:43:50 -0500
commit1b5420e1f587b05de49b36472fefad5949042d00 (patch)
tree7548769fb131f9c828fcc4cf16cf0dbf83940d18 /drivers/mfd
parent5d1d147f040253cbdccc6dbdd14a002403cf8490 (diff)
mfd: Use to_i2c_client() instead of open-coding it
Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/88pm80x.c4
-rw-r--r--drivers/mfd/88pm860x-core.c4
-rw-r--r--drivers/mfd/max14577.c4
-rw-r--r--drivers/mfd/max77686.c4
-rw-r--r--drivers/mfd/max77693.c4
-rw-r--r--drivers/mfd/max77843.c4
-rw-r--r--drivers/mfd/max8925-i2c.c4
-rw-r--r--drivers/mfd/max8997.c8
-rw-r--r--drivers/mfd/max8998.c8
-rw-r--r--drivers/mfd/sec-core.c4
10 files changed, 24 insertions, 24 deletions
diff --git a/drivers/mfd/88pm80x.c b/drivers/mfd/88pm80x.c
index 63445ea6b0bf..3f24ecbe2576 100644
--- a/drivers/mfd/88pm80x.c
+++ b/drivers/mfd/88pm80x.c
@@ -135,7 +135,7 @@ EXPORT_SYMBOL_GPL(pm80x_deinit);
135#ifdef CONFIG_PM_SLEEP 135#ifdef CONFIG_PM_SLEEP
136static int pm80x_suspend(struct device *dev) 136static int pm80x_suspend(struct device *dev)
137{ 137{
138 struct i2c_client *client = container_of(dev, struct i2c_client, dev); 138 struct i2c_client *client = to_i2c_client(dev);
139 struct pm80x_chip *chip = i2c_get_clientdata(client); 139 struct pm80x_chip *chip = i2c_get_clientdata(client);
140 140
141 if (chip && chip->wu_flag) 141 if (chip && chip->wu_flag)
@@ -147,7 +147,7 @@ static int pm80x_suspend(struct device *dev)
147 147
148static int pm80x_resume(struct device *dev) 148static int pm80x_resume(struct device *dev)
149{ 149{
150 struct i2c_client *client = container_of(dev, struct i2c_client, dev); 150 struct i2c_client *client = to_i2c_client(dev);
151 struct pm80x_chip *chip = i2c_get_clientdata(client); 151 struct pm80x_chip *chip = i2c_get_clientdata(client);
152 152
153 if (chip && chip->wu_flag) 153 if (chip && chip->wu_flag)
diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c
index 3269a9990b24..e497cee36066 100644
--- a/drivers/mfd/88pm860x-core.c
+++ b/drivers/mfd/88pm860x-core.c
@@ -1218,7 +1218,7 @@ static int pm860x_remove(struct i2c_client *client)
1218#ifdef CONFIG_PM_SLEEP 1218#ifdef CONFIG_PM_SLEEP
1219static int pm860x_suspend(struct device *dev) 1219static int pm860x_suspend(struct device *dev)
1220{ 1220{
1221 struct i2c_client *client = container_of(dev, struct i2c_client, dev); 1221 struct i2c_client *client = to_i2c_client(dev);
1222 struct pm860x_chip *chip = i2c_get_clientdata(client); 1222 struct pm860x_chip *chip = i2c_get_clientdata(client);
1223 1223
1224 if (device_may_wakeup(dev) && chip->wakeup_flag) 1224 if (device_may_wakeup(dev) && chip->wakeup_flag)
@@ -1228,7 +1228,7 @@ static int pm860x_suspend(struct device *dev)
1228 1228
1229static int pm860x_resume(struct device *dev) 1229static int pm860x_resume(struct device *dev)
1230{ 1230{
1231 struct i2c_client *client = container_of(dev, struct i2c_client, dev); 1231 struct i2c_client *client = to_i2c_client(dev);
1232 struct pm860x_chip *chip = i2c_get_clientdata(client); 1232 struct pm860x_chip *chip = i2c_get_clientdata(client);
1233 1233
1234 if (device_may_wakeup(dev) && chip->wakeup_flag) 1234 if (device_may_wakeup(dev) && chip->wakeup_flag)
diff --git a/drivers/mfd/max14577.c b/drivers/mfd/max14577.c
index 56e216dedc91..2280b3fdcf68 100644
--- a/drivers/mfd/max14577.c
+++ b/drivers/mfd/max14577.c
@@ -495,7 +495,7 @@ MODULE_DEVICE_TABLE(i2c, max14577_i2c_id);
495#ifdef CONFIG_PM_SLEEP 495#ifdef CONFIG_PM_SLEEP
496static int max14577_suspend(struct device *dev) 496static int max14577_suspend(struct device *dev)
497{ 497{
498 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 498 struct i2c_client *i2c = to_i2c_client(dev);
499 struct max14577 *max14577 = i2c_get_clientdata(i2c); 499 struct max14577 *max14577 = i2c_get_clientdata(i2c);
500 500
501 if (device_may_wakeup(dev)) 501 if (device_may_wakeup(dev))
@@ -516,7 +516,7 @@ static int max14577_suspend(struct device *dev)
516 516
517static int max14577_resume(struct device *dev) 517static int max14577_resume(struct device *dev)
518{ 518{
519 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 519 struct i2c_client *i2c = to_i2c_client(dev);
520 struct max14577 *max14577 = i2c_get_clientdata(i2c); 520 struct max14577 *max14577 = i2c_get_clientdata(i2c);
521 521
522 if (device_may_wakeup(dev)) 522 if (device_may_wakeup(dev))
diff --git a/drivers/mfd/max77686.c b/drivers/mfd/max77686.c
index d19be64cd32b..d959ebbb2194 100644
--- a/drivers/mfd/max77686.c
+++ b/drivers/mfd/max77686.c
@@ -352,7 +352,7 @@ MODULE_DEVICE_TABLE(i2c, max77686_i2c_id);
352#ifdef CONFIG_PM_SLEEP 352#ifdef CONFIG_PM_SLEEP
353static int max77686_suspend(struct device *dev) 353static int max77686_suspend(struct device *dev)
354{ 354{
355 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 355 struct i2c_client *i2c = to_i2c_client(dev);
356 struct max77686_dev *max77686 = i2c_get_clientdata(i2c); 356 struct max77686_dev *max77686 = i2c_get_clientdata(i2c);
357 357
358 if (device_may_wakeup(dev)) 358 if (device_may_wakeup(dev))
@@ -374,7 +374,7 @@ static int max77686_suspend(struct device *dev)
374 374
375static int max77686_resume(struct device *dev) 375static int max77686_resume(struct device *dev)
376{ 376{
377 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 377 struct i2c_client *i2c = to_i2c_client(dev);
378 struct max77686_dev *max77686 = i2c_get_clientdata(i2c); 378 struct max77686_dev *max77686 = i2c_get_clientdata(i2c);
379 379
380 if (device_may_wakeup(dev)) 380 if (device_may_wakeup(dev))
diff --git a/drivers/mfd/max77693.c b/drivers/mfd/max77693.c
index 007f729e150b..b83b7a7da1ae 100644
--- a/drivers/mfd/max77693.c
+++ b/drivers/mfd/max77693.c
@@ -334,7 +334,7 @@ MODULE_DEVICE_TABLE(i2c, max77693_i2c_id);
334 334
335static int max77693_suspend(struct device *dev) 335static int max77693_suspend(struct device *dev)
336{ 336{
337 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 337 struct i2c_client *i2c = to_i2c_client(dev);
338 struct max77693_dev *max77693 = i2c_get_clientdata(i2c); 338 struct max77693_dev *max77693 = i2c_get_clientdata(i2c);
339 339
340 if (device_may_wakeup(dev)) { 340 if (device_may_wakeup(dev)) {
@@ -347,7 +347,7 @@ static int max77693_suspend(struct device *dev)
347 347
348static int max77693_resume(struct device *dev) 348static int max77693_resume(struct device *dev)
349{ 349{
350 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 350 struct i2c_client *i2c = to_i2c_client(dev);
351 struct max77693_dev *max77693 = i2c_get_clientdata(i2c); 351 struct max77693_dev *max77693 = i2c_get_clientdata(i2c);
352 352
353 if (device_may_wakeup(dev)) { 353 if (device_may_wakeup(dev)) {
diff --git a/drivers/mfd/max77843.c b/drivers/mfd/max77843.c
index 586098f1b233..7cfc95b49c5d 100644
--- a/drivers/mfd/max77843.c
+++ b/drivers/mfd/max77843.c
@@ -197,7 +197,7 @@ MODULE_DEVICE_TABLE(i2c, max77843_id);
197 197
198static int __maybe_unused max77843_suspend(struct device *dev) 198static int __maybe_unused max77843_suspend(struct device *dev)
199{ 199{
200 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 200 struct i2c_client *i2c = to_i2c_client(dev);
201 struct max77693_dev *max77843 = i2c_get_clientdata(i2c); 201 struct max77693_dev *max77843 = i2c_get_clientdata(i2c);
202 202
203 disable_irq(max77843->irq); 203 disable_irq(max77843->irq);
@@ -209,7 +209,7 @@ static int __maybe_unused max77843_suspend(struct device *dev)
209 209
210static int __maybe_unused max77843_resume(struct device *dev) 210static int __maybe_unused max77843_resume(struct device *dev)
211{ 211{
212 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 212 struct i2c_client *i2c = to_i2c_client(dev);
213 struct max77693_dev *max77843 = i2c_get_clientdata(i2c); 213 struct max77693_dev *max77843 = i2c_get_clientdata(i2c);
214 214
215 if (device_may_wakeup(dev)) 215 if (device_may_wakeup(dev))
diff --git a/drivers/mfd/max8925-i2c.c b/drivers/mfd/max8925-i2c.c
index b0fe8103e401..70443b161a5b 100644
--- a/drivers/mfd/max8925-i2c.c
+++ b/drivers/mfd/max8925-i2c.c
@@ -215,7 +215,7 @@ static int max8925_remove(struct i2c_client *client)
215#ifdef CONFIG_PM_SLEEP 215#ifdef CONFIG_PM_SLEEP
216static int max8925_suspend(struct device *dev) 216static int max8925_suspend(struct device *dev)
217{ 217{
218 struct i2c_client *client = container_of(dev, struct i2c_client, dev); 218 struct i2c_client *client = to_i2c_client(dev);
219 struct max8925_chip *chip = i2c_get_clientdata(client); 219 struct max8925_chip *chip = i2c_get_clientdata(client);
220 220
221 if (device_may_wakeup(dev) && chip->wakeup_flag) 221 if (device_may_wakeup(dev) && chip->wakeup_flag)
@@ -225,7 +225,7 @@ static int max8925_suspend(struct device *dev)
225 225
226static int max8925_resume(struct device *dev) 226static int max8925_resume(struct device *dev)
227{ 227{
228 struct i2c_client *client = container_of(dev, struct i2c_client, dev); 228 struct i2c_client *client = to_i2c_client(dev);
229 struct max8925_chip *chip = i2c_get_clientdata(client); 229 struct max8925_chip *chip = i2c_get_clientdata(client);
230 230
231 if (device_may_wakeup(dev) && chip->wakeup_flag) 231 if (device_may_wakeup(dev) && chip->wakeup_flag)
diff --git a/drivers/mfd/max8997.c b/drivers/mfd/max8997.c
index 156ed6f92aa3..f316348e3d98 100644
--- a/drivers/mfd/max8997.c
+++ b/drivers/mfd/max8997.c
@@ -437,7 +437,7 @@ static u8 max8997_dumpaddr_haptic[] = {
437 437
438static int max8997_freeze(struct device *dev) 438static int max8997_freeze(struct device *dev)
439{ 439{
440 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 440 struct i2c_client *i2c = to_i2c_client(dev);
441 struct max8997_dev *max8997 = i2c_get_clientdata(i2c); 441 struct max8997_dev *max8997 = i2c_get_clientdata(i2c);
442 int i; 442 int i;
443 443
@@ -459,7 +459,7 @@ static int max8997_freeze(struct device *dev)
459 459
460static int max8997_restore(struct device *dev) 460static int max8997_restore(struct device *dev)
461{ 461{
462 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 462 struct i2c_client *i2c = to_i2c_client(dev);
463 struct max8997_dev *max8997 = i2c_get_clientdata(i2c); 463 struct max8997_dev *max8997 = i2c_get_clientdata(i2c);
464 int i; 464 int i;
465 465
@@ -481,7 +481,7 @@ static int max8997_restore(struct device *dev)
481 481
482static int max8997_suspend(struct device *dev) 482static int max8997_suspend(struct device *dev)
483{ 483{
484 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 484 struct i2c_client *i2c = to_i2c_client(dev);
485 struct max8997_dev *max8997 = i2c_get_clientdata(i2c); 485 struct max8997_dev *max8997 = i2c_get_clientdata(i2c);
486 486
487 if (device_may_wakeup(dev)) 487 if (device_may_wakeup(dev))
@@ -491,7 +491,7 @@ static int max8997_suspend(struct device *dev)
491 491
492static int max8997_resume(struct device *dev) 492static int max8997_resume(struct device *dev)
493{ 493{
494 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 494 struct i2c_client *i2c = to_i2c_client(dev);
495 struct max8997_dev *max8997 = i2c_get_clientdata(i2c); 495 struct max8997_dev *max8997 = i2c_get_clientdata(i2c);
496 496
497 if (device_may_wakeup(dev)) 497 if (device_may_wakeup(dev))
diff --git a/drivers/mfd/max8998.c b/drivers/mfd/max8998.c
index a7afe3bf27fc..ab28b29400f6 100644
--- a/drivers/mfd/max8998.c
+++ b/drivers/mfd/max8998.c
@@ -274,7 +274,7 @@ MODULE_DEVICE_TABLE(i2c, max8998_i2c_id);
274 274
275static int max8998_suspend(struct device *dev) 275static int max8998_suspend(struct device *dev)
276{ 276{
277 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 277 struct i2c_client *i2c = to_i2c_client(dev);
278 struct max8998_dev *max8998 = i2c_get_clientdata(i2c); 278 struct max8998_dev *max8998 = i2c_get_clientdata(i2c);
279 279
280 if (device_may_wakeup(dev)) 280 if (device_may_wakeup(dev))
@@ -284,7 +284,7 @@ static int max8998_suspend(struct device *dev)
284 284
285static int max8998_resume(struct device *dev) 285static int max8998_resume(struct device *dev)
286{ 286{
287 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 287 struct i2c_client *i2c = to_i2c_client(dev);
288 struct max8998_dev *max8998 = i2c_get_clientdata(i2c); 288 struct max8998_dev *max8998 = i2c_get_clientdata(i2c);
289 289
290 if (device_may_wakeup(dev)) 290 if (device_may_wakeup(dev))
@@ -344,7 +344,7 @@ static struct max8998_reg_dump max8998_dump[] = {
344/* Save registers before hibernation */ 344/* Save registers before hibernation */
345static int max8998_freeze(struct device *dev) 345static int max8998_freeze(struct device *dev)
346{ 346{
347 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 347 struct i2c_client *i2c = to_i2c_client(dev);
348 int i; 348 int i;
349 349
350 for (i = 0; i < ARRAY_SIZE(max8998_dump); i++) 350 for (i = 0; i < ARRAY_SIZE(max8998_dump); i++)
@@ -357,7 +357,7 @@ static int max8998_freeze(struct device *dev)
357/* Restore registers after hibernation */ 357/* Restore registers after hibernation */
358static int max8998_restore(struct device *dev) 358static int max8998_restore(struct device *dev)
359{ 359{
360 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 360 struct i2c_client *i2c = to_i2c_client(dev);
361 int i; 361 int i;
362 362
363 for (i = 0; i < ARRAY_SIZE(max8998_dump); i++) 363 for (i = 0; i < ARRAY_SIZE(max8998_dump); i++)
diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index c9802ba9be72..400e1d7d8d08 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -536,7 +536,7 @@ static void sec_pmic_shutdown(struct i2c_client *i2c)
536#ifdef CONFIG_PM_SLEEP 536#ifdef CONFIG_PM_SLEEP
537static int sec_pmic_suspend(struct device *dev) 537static int sec_pmic_suspend(struct device *dev)
538{ 538{
539 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 539 struct i2c_client *i2c = to_i2c_client(dev);
540 struct sec_pmic_dev *sec_pmic = i2c_get_clientdata(i2c); 540 struct sec_pmic_dev *sec_pmic = i2c_get_clientdata(i2c);
541 541
542 if (device_may_wakeup(dev)) 542 if (device_may_wakeup(dev))
@@ -557,7 +557,7 @@ static int sec_pmic_suspend(struct device *dev)
557 557
558static int sec_pmic_resume(struct device *dev) 558static int sec_pmic_resume(struct device *dev)
559{ 559{
560 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 560 struct i2c_client *i2c = to_i2c_client(dev);
561 struct sec_pmic_dev *sec_pmic = i2c_get_clientdata(i2c); 561 struct sec_pmic_dev *sec_pmic = i2c_get_clientdata(i2c);
562 562
563 if (device_may_wakeup(dev)) 563 if (device_may_wakeup(dev))