diff options
author | Paul Cercueil <paul@crapouillou.net> | 2022-10-23 12:48:28 +0300 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2022-12-07 16:28:10 +0300 |
commit | 52c9d7193ba4342239a47a5524884f7a0a667e4d (patch) | |
tree | 7974de25e1fcc4571ae367d363cb352bb2e33fd7 /drivers/mfd/max8925-i2c.c | |
parent | 5745a90a930c81b55dfcb67b5e904b3cb1df0c7a (diff) | |
download | linux-52c9d7193ba4342239a47a5524884f7a0a667e4d.tar.xz |
mfd: max8925-i2c: 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>
Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/mfd/max8925-i2c.c')
-rw-r--r-- | drivers/mfd/max8925-i2c.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/mfd/max8925-i2c.c b/drivers/mfd/max8925-i2c.c index 7c3ec167f941..4057fd15c29e 100644 --- a/drivers/mfd/max8925-i2c.c +++ b/drivers/mfd/max8925-i2c.c @@ -206,7 +206,6 @@ static void max8925_remove(struct i2c_client *client) i2c_unregister_device(chip->rtc); } -#ifdef CONFIG_PM_SLEEP static int max8925_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); @@ -226,9 +225,9 @@ static int max8925_resume(struct device *dev) disable_irq_wake(chip->core_irq); return 0; } -#endif -static SIMPLE_DEV_PM_OPS(max8925_pm_ops, max8925_suspend, max8925_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(max8925_pm_ops, + max8925_suspend, max8925_resume); static const struct of_device_id max8925_dt_ids[] = { { .compatible = "maxim,max8925", }, @@ -238,7 +237,7 @@ static const struct of_device_id max8925_dt_ids[] = { static struct i2c_driver max8925_driver = { .driver = { .name = "max8925", - .pm = &max8925_pm_ops, + .pm = pm_sleep_ptr(&max8925_pm_ops), .of_match_table = max8925_dt_ids, }, .probe_new = max8925_probe, |