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: sprd-sc27xx: 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
69bbab91 4060c6e5

+3 -4
+3 -4
drivers/mfd/sprd-sc27xx-spi.c
··· 215 215 return 0; 216 216 } 217 217 218 - #ifdef CONFIG_PM_SLEEP 219 218 static int sprd_pmic_suspend(struct device *dev) 220 219 { 221 220 struct sprd_pmic *ddata = dev_get_drvdata(dev); ··· 234 235 235 236 return 0; 236 237 } 237 - #endif 238 238 239 - static SIMPLE_DEV_PM_OPS(sprd_pmic_pm_ops, sprd_pmic_suspend, sprd_pmic_resume); 239 + static DEFINE_SIMPLE_DEV_PM_OPS(sprd_pmic_pm_ops, 240 + sprd_pmic_suspend, sprd_pmic_resume); 240 241 241 242 static const struct of_device_id sprd_pmic_match[] = { 242 243 { .compatible = "sprd,sc2730", .data = &sc2730_data }, ··· 256 257 .driver = { 257 258 .name = "sc27xx-pmic", 258 259 .of_match_table = sprd_pmic_match, 259 - .pm = &sprd_pmic_pm_ops, 260 + .pm = pm_sleep_ptr(&sprd_pmic_pm_ops), 260 261 }, 261 262 .probe = sprd_pmic_probe, 262 263 .id_table = sprd_pmic_spi_ids,