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: arizona: Remove #ifdef guards for PM related functions

Only export the arizona_pm_ops if CONFIG_PM is set, but leave the
suspend/resume functions (and related code) outside #ifdef guards.

If CONFIG_PM is not set, the arizona_pm_ops will be defined as
"static __maybe_unused", and the structure plus all the callbacks will
be automatically dropped by the compiler.

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>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Paul Cercueil and committed by
Lee Jones
50d3ac7d daf7ea81

+9 -14
+7 -12
drivers/mfd/arizona-core.c
··· 480 480 return 0; 481 481 } 482 482 483 - #ifdef CONFIG_PM 484 483 static int arizona_isolate_dcvdd(struct arizona *arizona) 485 484 { 486 485 int ret; ··· 741 742 742 743 return 0; 743 744 } 744 - #endif 745 745 746 - #ifdef CONFIG_PM_SLEEP 747 746 static int arizona_suspend(struct device *dev) 748 747 { 749 748 struct arizona *arizona = dev_get_drvdata(dev); ··· 781 784 782 785 return 0; 783 786 } 784 - #endif 785 787 786 - const struct dev_pm_ops arizona_pm_ops = { 787 - SET_RUNTIME_PM_OPS(arizona_runtime_suspend, 788 - arizona_runtime_resume, 789 - NULL) 790 - SET_SYSTEM_SLEEP_PM_OPS(arizona_suspend, arizona_resume) 791 - SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(arizona_suspend_noirq, 792 - arizona_resume_noirq) 788 + EXPORT_GPL_DEV_PM_OPS(arizona_pm_ops) = { 789 + RUNTIME_PM_OPS(arizona_runtime_suspend, 790 + arizona_runtime_resume, 791 + NULL) 792 + SYSTEM_SLEEP_PM_OPS(arizona_suspend, arizona_resume) 793 + NOIRQ_SYSTEM_SLEEP_PM_OPS(arizona_suspend_noirq, 794 + arizona_resume_noirq) 793 795 }; 794 - EXPORT_SYMBOL_GPL(arizona_pm_ops); 795 796 796 797 #ifdef CONFIG_OF 797 798 static int arizona_of_get_core_pdata(struct arizona *arizona)
+1 -1
drivers/mfd/arizona-i2c.c
··· 117 117 static struct i2c_driver arizona_i2c_driver = { 118 118 .driver = { 119 119 .name = "arizona", 120 - .pm = &arizona_pm_ops, 120 + .pm = pm_ptr(&arizona_pm_ops), 121 121 .of_match_table = of_match_ptr(arizona_i2c_of_match), 122 122 }, 123 123 .probe_new = arizona_i2c_probe,
+1 -1
drivers/mfd/arizona-spi.c
··· 282 282 static struct spi_driver arizona_spi_driver = { 283 283 .driver = { 284 284 .name = "arizona", 285 - .pm = &arizona_pm_ops, 285 + .pm = pm_ptr(&arizona_pm_ops), 286 286 .of_match_table = of_match_ptr(arizona_spi_of_match), 287 287 .acpi_match_table = ACPI_PTR(arizona_acpi_match), 288 288 },