diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-04-11 05:24:40 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-11 15:39:02 -0400 |
commit | 5d4717d76f06d56586addcda59572113167e07da (patch) | |
tree | 871864d1419f3b0cf64b10bb6e8652ffffc3a356 /drivers/misc/fsa9480.c | |
parent | 1c9354b0973a59a0292ec64e0b4dde7b9462931a (diff) |
misc: fsa8480: Use dev_pm_ops
Use dev_pm_ops instead of the deprecated legacy suspend/resume callbacks.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Donggeun Kim <dg77.kim@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/fsa9480.c')
-rw-r--r-- | drivers/misc/fsa9480.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/misc/fsa9480.c b/drivers/misc/fsa9480.c index e8cbb1c59f4c..a725c79c35f5 100644 --- a/drivers/misc/fsa9480.c +++ b/drivers/misc/fsa9480.c | |||
@@ -474,10 +474,11 @@ static int fsa9480_remove(struct i2c_client *client) | |||
474 | return 0; | 474 | return 0; |
475 | } | 475 | } |
476 | 476 | ||
477 | #ifdef CONFIG_PM | 477 | #ifdef CONFIG_PM_SLEEP |
478 | 478 | ||
479 | static int fsa9480_suspend(struct i2c_client *client, pm_message_t state) | 479 | static int fsa9480_suspend(struct device *dev) |
480 | { | 480 | { |
481 | struct i2c_client *client = to_i2c_client(dev); | ||
481 | struct fsa9480_usbsw *usbsw = i2c_get_clientdata(client); | 482 | struct fsa9480_usbsw *usbsw = i2c_get_clientdata(client); |
482 | struct fsa9480_platform_data *pdata = usbsw->pdata; | 483 | struct fsa9480_platform_data *pdata = usbsw->pdata; |
483 | 484 | ||
@@ -490,8 +491,9 @@ static int fsa9480_suspend(struct i2c_client *client, pm_message_t state) | |||
490 | return 0; | 491 | return 0; |
491 | } | 492 | } |
492 | 493 | ||
493 | static int fsa9480_resume(struct i2c_client *client) | 494 | static int fsa9480_resume(struct device *dev) |
494 | { | 495 | { |
496 | struct i2c_client *client = to_i2c_client(dev); | ||
495 | struct fsa9480_usbsw *usbsw = i2c_get_clientdata(client); | 497 | struct fsa9480_usbsw *usbsw = i2c_get_clientdata(client); |
496 | int dev1, dev2; | 498 | int dev1, dev2; |
497 | 499 | ||
@@ -515,12 +517,14 @@ static int fsa9480_resume(struct i2c_client *client) | |||
515 | return 0; | 517 | return 0; |
516 | } | 518 | } |
517 | 519 | ||
520 | static SIMPLE_DEV_PM_OPS(fsa9480_pm_ops, fsa9480_suspend, fsa9480_resume); | ||
521 | #define FSA9480_PM_OPS (&fsa9480_pm_ops) | ||
522 | |||
518 | #else | 523 | #else |
519 | 524 | ||
520 | #define fsa9480_suspend NULL | 525 | #define FSA9480_PM_OPS NULL |
521 | #define fsa9480_resume NULL | ||
522 | 526 | ||
523 | #endif /* CONFIG_PM */ | 527 | #endif /* CONFIG_PM_SLEEP */ |
524 | 528 | ||
525 | static const struct i2c_device_id fsa9480_id[] = { | 529 | static const struct i2c_device_id fsa9480_id[] = { |
526 | {"fsa9480", 0}, | 530 | {"fsa9480", 0}, |
@@ -531,11 +535,10 @@ MODULE_DEVICE_TABLE(i2c, fsa9480_id); | |||
531 | static struct i2c_driver fsa9480_i2c_driver = { | 535 | static struct i2c_driver fsa9480_i2c_driver = { |
532 | .driver = { | 536 | .driver = { |
533 | .name = "fsa9480", | 537 | .name = "fsa9480", |
538 | .pm = FSA9480_PM_OPS, | ||
534 | }, | 539 | }, |
535 | .probe = fsa9480_probe, | 540 | .probe = fsa9480_probe, |
536 | .remove = fsa9480_remove, | 541 | .remove = fsa9480_remove, |
537 | .resume = fsa9480_resume, | ||
538 | .suspend = fsa9480_suspend, | ||
539 | .id_table = fsa9480_id, | 542 | .id_table = fsa9480_id, |
540 | }; | 543 | }; |
541 | 544 | ||