Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Joonyoung Shim and committed by
Mauro Carvalho Chehab
949cf31c 0830be3f

+9 -7
+9 -7
drivers/media/radio/si470x/radio-si470x-i2c.c
··· 504 504 /* 505 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 510 struct si470x_device *radio = i2c_get_clientdata(client); 510 511 511 512 /* power down */ ··· 521 520 /* 522 521 * si470x_i2c_resume - resume the device 523 522 */ 524 - static int si470x_i2c_resume(struct i2c_client *client) 523 + static int si470x_i2c_resume(struct device *dev) 525 524 { 525 + struct i2c_client *client = to_i2c_client(dev); 526 526 struct si470x_device *radio = i2c_get_clientdata(client); 527 527 528 528 /* power up : need 110ms */ ··· 534 532 535 533 return 0; 536 534 } 537 - #else 538 - #define si470x_i2c_suspend NULL 539 - #define si470x_i2c_resume NULL 535 + 536 + static SIMPLE_DEV_PM_OPS(si470x_i2c_pm, si470x_i2c_suspend, si470x_i2c_resume); 540 537 #endif 541 538 542 539 ··· 546 545 .driver = { 547 546 .name = "si470x", 548 547 .owner = THIS_MODULE, 548 + #ifdef CONFIG_PM 549 + .pm = &si470x_i2c_pm, 550 + #endif 549 551 }, 550 552 .probe = si470x_i2c_probe, 551 553 .remove = __devexit_p(si470x_i2c_remove), 552 - .suspend = si470x_i2c_suspend, 553 - .resume = si470x_i2c_resume, 554 554 .id_table = si470x_i2c_id, 555 555 }; 556 556