Skip to content

Commit 4848229

Browse files
glaubitzMarc Zyngier
authored andcommitted
irqchip/jcore-aic: Fix missing allocation of IRQ descriptors
The initialization function for the J-Core AIC aic_irq_of_init() is currently missing the call to irq_alloc_descs() which allocates and initializes all the IRQ descriptors. Add missing function call and return the error code from irq_alloc_descs() in case the allocation fails. Fixes: 981b58f ("irqchip/jcore-aic: Add J-Core AIC driver") Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> Tested-by: Rob Landley <rob@landley.net> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20230510163343.43090-1-glaubitz@physik.fu-berlin.de
1 parent 48f31e4 commit 4848229

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/irqchip/irq-jcore-aic.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ static int __init aic_irq_of_init(struct device_node *node,
6868
unsigned min_irq = JCORE_AIC2_MIN_HWIRQ;
6969
unsigned dom_sz = JCORE_AIC_MAX_HWIRQ+1;
7070
struct irq_domain *domain;
71+
int ret;
7172

7273
pr_info("Initializing J-Core AIC\n");
7374

@@ -100,6 +101,12 @@ static int __init aic_irq_of_init(struct device_node *node,
100101
jcore_aic.irq_unmask = noop;
101102
jcore_aic.name = "AIC";
102103

104+
ret = irq_alloc_descs(-1, min_irq, dom_sz - min_irq,
105+
of_node_to_nid(node));
106+
107+
if (ret < 0)
108+
return ret;
109+
103110
domain = irq_domain_add_legacy(node, dom_sz - min_irq, min_irq, min_irq,
104111
&jcore_aic_irqdomain_ops,
105112
&jcore_aic);

0 commit comments

Comments
 (0)