summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Cercueil <paul@crapouillou.net>2022-10-23 10:48:39 +0100
committerLee Jones <lee@kernel.org>2022-12-07 13:28:12 +0000
commitd115e88c297546192354f65be6c0343a68910afb (patch)
tree752841144adf4c70be465d3bc77292fc6ed5e4e4
parent2d81212cb0c811db0e74b959fd48b2ba19b77e0f (diff)
downloadlinux-stable-d115e88c297546192354f65be6c0343a68910afb.tar.gz
linux-stable-d115e88c297546192354f65be6c0343a68910afb.tar.bz2
linux-stable-d115e88c297546192354f65be6c0343a68910afb.zip
mfd: tps6586x: 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>
-rw-r--r--drivers/mfd/tps6586x.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c
index 92703e975ffa..2d947f3f606a 100644
--- a/drivers/mfd/tps6586x.c
+++ b/drivers/mfd/tps6586x.c
@@ -269,15 +269,11 @@ static void tps6586x_irq_sync_unlock(struct irq_data *data)
mutex_unlock(&tps6586x->irq_lock);
}
-#ifdef CONFIG_PM_SLEEP
static int tps6586x_irq_set_wake(struct irq_data *irq_data, unsigned int on)
{
struct tps6586x *tps6586x = irq_data_get_irq_chip_data(irq_data);
return irq_set_irq_wake(tps6586x->irq, on);
}
-#else
-#define tps6586x_irq_set_wake NULL
-#endif
static struct irq_chip tps6586x_irq_chip = {
.name = "tps6586x",
@@ -285,7 +281,7 @@ static struct irq_chip tps6586x_irq_chip = {
.irq_bus_sync_unlock = tps6586x_irq_sync_unlock,
.irq_disable = tps6586x_irq_disable,
.irq_enable = tps6586x_irq_enable,
- .irq_set_wake = tps6586x_irq_set_wake,
+ .irq_set_wake = pm_sleep_ptr(tps6586x_irq_set_wake),
};
static int tps6586x_irq_map(struct irq_domain *h, unsigned int virq,