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

Configure Feed

Select the types of activity you want to include in your feed.

mfd: max77620: Remove #ifdef guards for PM related functions

Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
to handle the .suspend/.resume callbacks.

These macros allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.

This has the advantage of always compiling these functions in,
independently of any Kconfig option. Thanks to that, bugs and other
regressions are subsequently easier to catch.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Paul Cercueil and committed by
Lee Jones
9b990dc9 9dd3baec

+3 -6
+3 -6
drivers/mfd/max77620.c
··· 576 576 return 0; 577 577 } 578 578 579 - #ifdef CONFIG_PM_SLEEP 580 579 static int max77620_set_fps_period(struct max77620_chip *chip, 581 580 int fps_id, int time_period) 582 581 { ··· 682 683 683 684 return 0; 684 685 } 685 - #endif 686 686 687 687 static const struct i2c_device_id max77620_id[] = { 688 688 {"max77620", MAX77620}, ··· 690 692 {}, 691 693 }; 692 694 693 - static const struct dev_pm_ops max77620_pm_ops = { 694 - SET_SYSTEM_SLEEP_PM_OPS(max77620_i2c_suspend, max77620_i2c_resume) 695 - }; 695 + static DEFINE_SIMPLE_DEV_PM_OPS(max77620_pm_ops, 696 + max77620_i2c_suspend, max77620_i2c_resume); 696 697 697 698 static struct i2c_driver max77620_driver = { 698 699 .driver = { 699 700 .name = "max77620", 700 - .pm = &max77620_pm_ops, 701 + .pm = pm_sleep_ptr(&max77620_pm_ops), 701 702 }, 702 703 .probe_new = max77620_probe, 703 704 .id_table = max77620_id,