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: tc6387xb: 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
2d81212c 3833239b

+2 -7
+2 -7
drivers/mfd/tc6387xb.c
··· 40 40 41 41 /*--------------------------------------------------------------------------*/ 42 42 43 - #ifdef CONFIG_PM 44 43 static int tc6387xb_suspend(struct platform_device *dev, pm_message_t state) 45 44 { 46 45 struct tc6387xb *tc6387xb = platform_get_drvdata(dev); ··· 66 67 67 68 return 0; 68 69 } 69 - #else 70 - #define tc6387xb_suspend NULL 71 - #define tc6387xb_resume NULL 72 - #endif 73 70 74 71 /*--------------------------------------------------------------------------*/ 75 72 ··· 215 220 }, 216 221 .probe = tc6387xb_probe, 217 222 .remove = tc6387xb_remove, 218 - .suspend = tc6387xb_suspend, 219 - .resume = tc6387xb_resume, 223 + .suspend = pm_sleep_ptr(tc6387xb_suspend), 224 + .resume = pm_sleep_ptr(tc6387xb_resume), 220 225 }; 221 226 222 227 module_platform_driver(tc6387xb_platform_driver);