summaryrefslogtreecommitdiff
path: root/drivers/mfd/rc5t583-irq.c
diff options
context:
space:
mode:
authorPaul Cercueil <paul@crapouillou.net>2022-10-23 10:48:31 +0100
committerLee Jones <lee@kernel.org>2022-12-07 13:28:11 +0000
commit2662b90fd58b8833894948be07c2f44bfa782ed8 (patch)
treea1e41c44d82f597354129408efd66c8bf822e1e0 /drivers/mfd/rc5t583-irq.c
parent245cb473e5388fcbc01c7284b6a4e1446cdbf054 (diff)
mfd: rc5t583-irq: Remove #ifdef guards for PM related functions
Use the new pm_sleep_ptr() macro to handle the .irq_set_wake() callback. This macro allows the mt6397_irq_set_wake() function 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/rc5t583-irq.c')
-rw-r--r--drivers/mfd/rc5t583-irq.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/mfd/rc5t583-irq.c b/drivers/mfd/rc5t583-irq.c
index b374a3d34688..621ea61fa7c6 100644
--- a/drivers/mfd/rc5t583-irq.c
+++ b/drivers/mfd/rc5t583-irq.c
@@ -228,15 +228,12 @@ static void rc5t583_irq_sync_unlock(struct irq_data *irq_data)
mutex_unlock(&rc5t583->irq_lock);
}
-#ifdef CONFIG_PM_SLEEP
+
static int rc5t583_irq_set_wake(struct irq_data *irq_data, unsigned int on)
{
struct rc5t583 *rc5t583 = irq_data_get_irq_chip_data(irq_data);
return irq_set_irq_wake(rc5t583->chip_irq, on);
}
-#else
-#define rc5t583_irq_set_wake NULL
-#endif
static irqreturn_t rc5t583_irq(int irq, void *data)
{
@@ -317,7 +314,7 @@ static struct irq_chip rc5t583_irq_chip = {
.irq_bus_lock = rc5t583_irq_lock,
.irq_bus_sync_unlock = rc5t583_irq_sync_unlock,
.irq_set_type = rc5t583_irq_set_type,
- .irq_set_wake = rc5t583_irq_set_wake,
+ .irq_set_wake = pm_sleep_ptr(rc5t583_irq_set_wake),
};
int rc5t583_irq_init(struct rc5t583 *rc5t583, int irq, int irq_base)