summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/t7l66xb.c
diff options
context:
space:
mode:
authorPaul Cercueil <paul@crapouillou.net>2022-10-23 10:48:42 +0100
committerLee Jones <lee@kernel.org>2022-12-07 13:28:12 +0000
commitdaf7ea817fda9e5094082a1dd99227001f7ef861 (patch)
tree3b9172cd5b12f11065e9d64fe71ec563df213793 /drivers/mfd/t7l66xb.c
parent9b990dc9f09fcdde272abc54ae0c158596149944 (diff)
downloadlinux-daf7ea817fda9e5094082a1dd99227001f7ef861.tar.bz2
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>
Diffstat (limited to 'drivers/mfd/t7l66xb.c')
-rw-r--r--drivers/mfd/t7l66xb.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/mfd/t7l66xb.c b/drivers/mfd/t7l66xb.c
index 663ffd4b8570..1d9d1d38d068 100644
--- a/drivers/mfd/t7l66xb.c
+++ b/drivers/mfd/t7l66xb.c
@@ -257,7 +257,6 @@ static void t7l66xb_detach_irq(struct platform_device *dev)
/*--------------------------------------------------------------------------*/
-#ifdef CONFIG_PM
static int t7l66xb_suspend(struct platform_device *dev, pm_message_t state)
{
struct t7l66xb *t7l66xb = platform_get_drvdata(dev);
@@ -288,10 +287,6 @@ static int t7l66xb_resume(struct platform_device *dev)
return 0;
}
-#else
-#define t7l66xb_suspend NULL
-#define t7l66xb_resume NULL
-#endif
/*--------------------------------------------------------------------------*/
@@ -416,8 +411,8 @@ static struct platform_driver t7l66xb_platform_driver = {
.driver = {
.name = "t7l66xb",
},
- .suspend = t7l66xb_suspend,
- .resume = t7l66xb_resume,
+ .suspend = pm_sleep_ptr(t7l66xb_suspend),
+ .resume = pm_sleep_ptr(t7l66xb_resume),
.probe = t7l66xb_probe,
.remove = t7l66xb_remove,
};