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: t7l66xb: 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
daf7ea81 9b990dc9

+2 -7
+2 -7
drivers/mfd/t7l66xb.c
··· 257 257 258 258 /*--------------------------------------------------------------------------*/ 259 259 260 - #ifdef CONFIG_PM 261 260 static int t7l66xb_suspend(struct platform_device *dev, pm_message_t state) 262 261 { 263 262 struct t7l66xb *t7l66xb = platform_get_drvdata(dev); ··· 287 288 288 289 return 0; 289 290 } 290 - #else 291 - #define t7l66xb_suspend NULL 292 - #define t7l66xb_resume NULL 293 - #endif 294 291 295 292 /*--------------------------------------------------------------------------*/ 296 293 ··· 411 416 .driver = { 412 417 .name = "t7l66xb", 413 418 }, 414 - .suspend = t7l66xb_suspend, 415 - .resume = t7l66xb_resume, 419 + .suspend = pm_sleep_ptr(t7l66xb_suspend), 420 + .resume = pm_sleep_ptr(t7l66xb_resume), 416 421 .probe = t7l66xb_probe, 417 422 .remove = t7l66xb_remove, 418 423 };