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: max14577: 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
8a8d0485 50d3ac7d

+2 -4
+2 -4
drivers/mfd/max14577.c
··· 480 480 }; 481 481 MODULE_DEVICE_TABLE(i2c, max14577_i2c_id); 482 482 483 - #ifdef CONFIG_PM_SLEEP 484 483 static int max14577_suspend(struct device *dev) 485 484 { 486 485 struct i2c_client *i2c = to_i2c_client(dev); ··· 512 513 513 514 return 0; 514 515 } 515 - #endif /* CONFIG_PM_SLEEP */ 516 516 517 - static SIMPLE_DEV_PM_OPS(max14577_pm, max14577_suspend, max14577_resume); 517 + static DEFINE_SIMPLE_DEV_PM_OPS(max14577_pm, max14577_suspend, max14577_resume); 518 518 519 519 static struct i2c_driver max14577_i2c_driver = { 520 520 .driver = { 521 521 .name = "max14577", 522 - .pm = &max14577_pm, 522 + .pm = pm_sleep_ptr(&max14577_pm), 523 523 .of_match_table = max14577_dt_match, 524 524 }, 525 525 .probe_new = max14577_i2c_probe,