summaryrefslogtreecommitdiff
path: root/drivers/mfd/pcf50633-core.c
diff options
context:
space:
mode:
authorPaul Cercueil <paul@crapouillou.net>2022-10-23 12:48:30 +0300
committerLee Jones <lee@kernel.org>2022-12-07 16:28:11 +0300
commit245cb473e5388fcbc01c7284b6a4e1446cdbf054 (patch)
treecffcf73611d49490e940bed66c06bbf5562d9ff4 /drivers/mfd/pcf50633-core.c
parente1243e0d72185c257ac2cdde1bbba130e24acf9a (diff)
downloadlinux-245cb473e5388fcbc01c7284b6a4e1446cdbf054.tar.xz
mfd: pcf50633: Remove #ifdef guards for PM related functions
Use the new EXPORT_GPL_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/pcf50633-core.c')
-rw-r--r--drivers/mfd/pcf50633-core.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c
index da39a7940560..0e4fc99e9f49 100644
--- a/drivers/mfd/pcf50633-core.c
+++ b/drivers/mfd/pcf50633-core.c
@@ -158,26 +158,6 @@ pcf50633_client_dev_register(struct pcf50633 *pcf, const char *name,
}
}
-#ifdef CONFIG_PM_SLEEP
-static int pcf50633_suspend(struct device *dev)
-{
- struct i2c_client *client = to_i2c_client(dev);
- struct pcf50633 *pcf = i2c_get_clientdata(client);
-
- return pcf50633_irq_suspend(pcf);
-}
-
-static int pcf50633_resume(struct device *dev)
-{
- struct i2c_client *client = to_i2c_client(dev);
- struct pcf50633 *pcf = i2c_get_clientdata(client);
-
- return pcf50633_irq_resume(pcf);
-}
-#endif
-
-static SIMPLE_DEV_PM_OPS(pcf50633_pm, pcf50633_suspend, pcf50633_resume);
-
static const struct regmap_config pcf50633_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
@@ -299,7 +279,7 @@ MODULE_DEVICE_TABLE(i2c, pcf50633_id_table);
static struct i2c_driver pcf50633_driver = {
.driver = {
.name = "pcf50633",
- .pm = &pcf50633_pm,
+ .pm = pm_sleep_ptr(&pcf50633_pm),
},
.id_table = pcf50633_id_table,
.probe_new = pcf50633_probe,