diff options
author | Joonyoung Shim <jy0922.shim@samsung.com> | 2011-03-11 01:54:47 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-05-20 08:27:45 -0400 |
commit | 949cf31cb00c16a1011c73c43f30cd3e2dfb6610 (patch) | |
tree | 5160c94571366c8b56ef8b36f3050365bb9e2748 | |
parent | 0830be3fe107372b375256c5303cabd85d4be234 (diff) |
[media] radio-si470x: convert to dev_pm_ops
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/radio/si470x/radio-si470x-i2c.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/media/radio/si470x/radio-si470x-i2c.c b/drivers/media/radio/si470x/radio-si470x-i2c.c index 5a2975ded5d..898f68a8361 100644 --- a/drivers/media/radio/si470x/radio-si470x-i2c.c +++ b/drivers/media/radio/si470x/radio-si470x-i2c.c | |||
@@ -504,8 +504,9 @@ static __devexit int si470x_i2c_remove(struct i2c_client *client) | |||
504 | /* | 504 | /* |
505 | * si470x_i2c_suspend - suspend the device | 505 | * si470x_i2c_suspend - suspend the device |
506 | */ | 506 | */ |
507 | static int si470x_i2c_suspend(struct i2c_client *client, pm_message_t mesg) | 507 | static int si470x_i2c_suspend(struct device *dev) |
508 | { | 508 | { |
509 | struct i2c_client *client = to_i2c_client(dev); | ||
509 | struct si470x_device *radio = i2c_get_clientdata(client); | 510 | struct si470x_device *radio = i2c_get_clientdata(client); |
510 | 511 | ||
511 | /* power down */ | 512 | /* power down */ |
@@ -520,8 +521,9 @@ static int si470x_i2c_suspend(struct i2c_client *client, pm_message_t mesg) | |||
520 | /* | 521 | /* |
521 | * si470x_i2c_resume - resume the device | 522 | * si470x_i2c_resume - resume the device |
522 | */ | 523 | */ |
523 | static int si470x_i2c_resume(struct i2c_client *client) | 524 | static int si470x_i2c_resume(struct device *dev) |
524 | { | 525 | { |
526 | struct i2c_client *client = to_i2c_client(dev); | ||
525 | struct si470x_device *radio = i2c_get_clientdata(client); | 527 | struct si470x_device *radio = i2c_get_clientdata(client); |
526 | 528 | ||
527 | /* power up : need 110ms */ | 529 | /* power up : need 110ms */ |
@@ -532,9 +534,8 @@ static int si470x_i2c_resume(struct i2c_client *client) | |||
532 | 534 | ||
533 | return 0; | 535 | return 0; |
534 | } | 536 | } |
535 | #else | 537 | |
536 | #define si470x_i2c_suspend NULL | 538 | static SIMPLE_DEV_PM_OPS(si470x_i2c_pm, si470x_i2c_suspend, si470x_i2c_resume); |
537 | #define si470x_i2c_resume NULL | ||
538 | #endif | 539 | #endif |
539 | 540 | ||
540 | 541 | ||
@@ -545,11 +546,12 @@ static struct i2c_driver si470x_i2c_driver = { | |||
545 | .driver = { | 546 | .driver = { |
546 | .name = "si470x", | 547 | .name = "si470x", |
547 | .owner = THIS_MODULE, | 548 | .owner = THIS_MODULE, |
549 | #ifdef CONFIG_PM | ||
550 | .pm = &si470x_i2c_pm, | ||
551 | #endif | ||
548 | }, | 552 | }, |
549 | .probe = si470x_i2c_probe, | 553 | .probe = si470x_i2c_probe, |
550 | .remove = __devexit_p(si470x_i2c_remove), | 554 | .remove = __devexit_p(si470x_i2c_remove), |
551 | .suspend = si470x_i2c_suspend, | ||
552 | .resume = si470x_i2c_resume, | ||
553 | .id_table = si470x_i2c_id, | 555 | .id_table = si470x_i2c_id, |
554 | }; | 556 | }; |
555 | 557 | ||