[PATCH 2/2] irqchip/atmel-aic5: remove #ifdef CONFIG_PM

Claudiu Beznea claudiu.beznea at microchip.com
Wed Jul 6 00:46:30 PDT 2022


Remove #ifdef CONFIG_PM around aic5_suspend() function and from
aic5_hw_init() function. Coding style recommends (at chapter Conditional
Compilation) to avoid using preprocessor conditional in .c files.
gc->chip_types->chip.irq_suspend()/gc->chip_types->chip.irq_resume() is
called in irq_gc_suspend()/irq_gc_resume() which is NULL in case CONFIG_PM
is not defined. With this gc->chip_types->chip.irq_pm_shutdown is
populated all the time as it should be as irq_gc_shutdown() is not
conditioned by CONFIG_PM.

Signed-off-by: Claudiu Beznea <claudiu.beznea at microchip.com>
---
 drivers/irqchip/irq-atmel-aic5.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/irqchip/irq-atmel-aic5.c b/drivers/irqchip/irq-atmel-aic5.c
index 145535bd7560..890df0cf57d6 100644
--- a/drivers/irqchip/irq-atmel-aic5.c
+++ b/drivers/irqchip/irq-atmel-aic5.c
@@ -149,7 +149,6 @@ static int aic5_set_type(struct irq_data *d, unsigned type)
 	return ret;
 }
 
-#ifdef CONFIG_PM
 static u32 *smr_cache;
 
 static void aic5_suspend(struct irq_data *d)
@@ -234,11 +233,6 @@ static void aic5_pm_shutdown(struct irq_data *d)
 	}
 	irq_gc_unlock(bgc);
 }
-#else
-#define aic5_suspend		NULL
-#define aic5_resume		NULL
-#define aic5_pm_shutdown	NULL
-#endif /* CONFIG_PM */
 
 static void __init aic5_hw_init(struct irq_domain *domain)
 {
@@ -369,12 +363,10 @@ static int __init aic5_of_init(struct device_node *node,
 static int __init sama5d2_aic5_of_init(struct device_node *node,
 				       struct device_node *parent)
 {
-#ifdef CONFIG_PM
 	smr_cache = kcalloc(DIV_ROUND_UP(NR_SAMA5D2_IRQS, 32) * 32,
 			    sizeof(*smr_cache), GFP_KERNEL);
 	if (!smr_cache)
 		return -ENOMEM;
-#endif
 
 	return aic5_of_init(node, parent, NR_SAMA5D2_IRQS);
 }
-- 
2.34.1




More information about the linux-arm-kernel mailing list