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: sec: 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>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Paul Cercueil and committed by
Lee Jones
270a7c3e ff84723e

+3 -4
+3 -4
drivers/mfd/sec-core.c
··· 454 454 regmap_update_bits(sec_pmic->regmap_pmic, reg, mask, 0); 455 455 } 456 456 457 - #ifdef CONFIG_PM_SLEEP 458 457 static int sec_pmic_suspend(struct device *dev) 459 458 { 460 459 struct i2c_client *i2c = to_i2c_client(dev); ··· 486 487 487 488 return 0; 488 489 } 489 - #endif /* CONFIG_PM_SLEEP */ 490 490 491 - static SIMPLE_DEV_PM_OPS(sec_pmic_pm_ops, sec_pmic_suspend, sec_pmic_resume); 491 + static DEFINE_SIMPLE_DEV_PM_OPS(sec_pmic_pm_ops, 492 + sec_pmic_suspend, sec_pmic_resume); 492 493 493 494 static struct i2c_driver sec_pmic_driver = { 494 495 .driver = { 495 496 .name = "sec_pmic", 496 - .pm = &sec_pmic_pm_ops, 497 + .pm = pm_sleep_ptr(&sec_pmic_pm_ops), 497 498 .of_match_table = sec_dt_match, 498 499 }, 499 500 .probe_new = sec_pmic_probe,