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: max77686: 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>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Paul Cercueil and committed by
Lee Jones
ef72ed42 8a8d0485

+2 -4
+2 -4
drivers/mfd/max77686.c
··· 226 226 return 0; 227 227 } 228 228 229 - #ifdef CONFIG_PM_SLEEP 230 229 static int max77686_suspend(struct device *dev) 231 230 { 232 231 struct i2c_client *i2c = to_i2c_client(dev); ··· 260 261 261 262 return 0; 262 263 } 263 - #endif /* CONFIG_PM_SLEEP */ 264 264 265 - static SIMPLE_DEV_PM_OPS(max77686_pm, max77686_suspend, max77686_resume); 265 + static DEFINE_SIMPLE_DEV_PM_OPS(max77686_pm, max77686_suspend, max77686_resume); 266 266 267 267 static struct i2c_driver max77686_i2c_driver = { 268 268 .driver = { 269 269 .name = "max77686", 270 - .pm = &max77686_pm, 270 + .pm = pm_sleep_ptr(&max77686_pm), 271 271 .of_match_table = max77686_pmic_dt_match, 272 272 }, 273 273 .probe_new = max77686_i2c_probe,