Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Paul Cercueil and committed by
Lee Jones
d115e88c 2d81212c

+1 -5
+1 -5
drivers/mfd/tps6586x.c
··· 269 269 mutex_unlock(&tps6586x->irq_lock); 270 270 } 271 271 272 - #ifdef CONFIG_PM_SLEEP 273 272 static int tps6586x_irq_set_wake(struct irq_data *irq_data, unsigned int on) 274 273 { 275 274 struct tps6586x *tps6586x = irq_data_get_irq_chip_data(irq_data); 276 275 return irq_set_irq_wake(tps6586x->irq, on); 277 276 } 278 - #else 279 - #define tps6586x_irq_set_wake NULL 280 - #endif 281 277 282 278 static struct irq_chip tps6586x_irq_chip = { 283 279 .name = "tps6586x", ··· 281 285 .irq_bus_sync_unlock = tps6586x_irq_sync_unlock, 282 286 .irq_disable = tps6586x_irq_disable, 283 287 .irq_enable = tps6586x_irq_enable, 284 - .irq_set_wake = tps6586x_irq_set_wake, 288 + .irq_set_wake = pm_sleep_ptr(tps6586x_irq_set_wake), 285 289 }; 286 290 287 291 static int tps6586x_irq_map(struct irq_domain *h, unsigned int virq,