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

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>

authored by

Lars-Peter Clausen and committed by
Greg Kroah-Hartman
5d4717d7 1c9354b0

+11 -8
+11 -8
drivers/misc/fsa9480.c
··· 474 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 482 struct fsa9480_usbsw *usbsw = i2c_get_clientdata(client); 482 483 struct fsa9480_platform_data *pdata = usbsw->pdata; 483 484 ··· 491 490 return 0; 492 491 } 493 492 494 - static int fsa9480_resume(struct i2c_client *client) 493 + static int fsa9480_resume(struct device *dev) 495 494 { 495 + struct i2c_client *client = to_i2c_client(dev); 496 496 struct fsa9480_usbsw *usbsw = i2c_get_clientdata(client); 497 497 int dev1, dev2; 498 498 ··· 517 515 return 0; 518 516 } 519 517 518 + static SIMPLE_DEV_PM_OPS(fsa9480_pm_ops, fsa9480_suspend, fsa9480_resume); 519 + #define FSA9480_PM_OPS (&fsa9480_pm_ops) 520 + 520 521 #else 521 522 522 - #define fsa9480_suspend NULL 523 - #define fsa9480_resume NULL 523 + #define FSA9480_PM_OPS NULL 524 524 525 - #endif /* CONFIG_PM */ 525 + #endif /* CONFIG_PM_SLEEP */ 526 526 527 527 static const struct i2c_device_id fsa9480_id[] = { 528 528 {"fsa9480", 0}, ··· 535 531 static struct i2c_driver fsa9480_i2c_driver = { 536 532 .driver = { 537 533 .name = "fsa9480", 534 + .pm = FSA9480_PM_OPS, 538 535 }, 539 536 .probe = fsa9480_probe, 540 537 .remove = fsa9480_remove, 541 - .resume = fsa9480_resume, 542 - .suspend = fsa9480_suspend, 543 538 .id_table = fsa9480_id, 544 539 }; 545 540