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

Use the new pm_sleep_ptr() macro to handle the .suspend/.resume
callbacks.

This macro 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
3833239b 270a7c3e

+2 -8
+2 -8
drivers/mfd/sm501.c
··· 1432 1432 1433 1433 } 1434 1434 1435 - #ifdef CONFIG_PM 1436 - 1437 1435 /* power management support */ 1438 1436 1439 1437 static void sm501_set_power(struct sm501_devdata *sm, int on) ··· 1507 1509 1508 1510 return 0; 1509 1511 } 1510 - #else 1511 - #define sm501_plat_suspend NULL 1512 - #define sm501_plat_resume NULL 1513 - #endif 1514 1512 1515 1513 /* Initialisation data for PCI devices */ 1516 1514 ··· 1708 1714 }, 1709 1715 .probe = sm501_plat_probe, 1710 1716 .remove = sm501_plat_remove, 1711 - .suspend = sm501_plat_suspend, 1712 - .resume = sm501_plat_resume, 1717 + .suspend = pm_sleep_ptr(sm501_plat_suspend), 1718 + .resume = pm_sleep_ptr(sm501_plat_resume), 1713 1719 }; 1714 1720 1715 1721 static int __init sm501_base_init(void)