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: motorola-cpcap: 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
4060c6e5 ef72ed42

+2 -4
+2 -4
drivers/mfd/motorola-cpcap.c
··· 221 221 .val_format_endian = REGMAP_ENDIAN_LITTLE, 222 222 }; 223 223 224 - #ifdef CONFIG_PM_SLEEP 225 224 static int cpcap_suspend(struct device *dev) 226 225 { 227 226 struct spi_device *spi = to_spi_device(dev); ··· 238 239 239 240 return 0; 240 241 } 241 - #endif 242 242 243 - static SIMPLE_DEV_PM_OPS(cpcap_pm, cpcap_suspend, cpcap_resume); 243 + static DEFINE_SIMPLE_DEV_PM_OPS(cpcap_pm, cpcap_suspend, cpcap_resume); 244 244 245 245 static const struct mfd_cell cpcap_mfd_devices[] = { 246 246 { ··· 344 346 .driver = { 345 347 .name = "cpcap-core", 346 348 .of_match_table = cpcap_of_match, 347 - .pm = &cpcap_pm, 349 + .pm = pm_sleep_ptr(&cpcap_pm), 348 350 }, 349 351 .probe = cpcap_probe, 350 352 .id_table = cpcap_spi_ids,