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>
This commit is contained in:
parent
245cb473e5
commit
2662b90fd5
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue