Skip to content

Commit

Permalink
irqchip: ingenic: Error out if IRQ domain creation failed
Browse files Browse the repository at this point in the history
BugLink: https://bugs.launchpad.net/bugs/1860816

[ Upstream commit 52ecc87 ]

If we cannot create the IRQ domain, the driver should fail to probe
instead of succeeding with just a warning message.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/1570015525-27018-3-git-send-email-zhouyanjie@zoho.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
  • Loading branch information
pcercuei authored and kelmously committed Jan 29, 2020
1 parent 8253a4c commit 0419ec2
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions drivers/irqchip/irq-ingenic.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ static int __init ingenic_intc_of_init(struct device_node *node,
goto out_unmap_irq;
}

domain = irq_domain_add_legacy(node, num_chips * 32,
JZ4740_IRQ_BASE, 0,
&irq_domain_simple_ops, NULL);
if (!domain) {
err = -ENOMEM;
goto out_unmap_base;
}

for (i = 0; i < num_chips; i++) {
/* Mask all irqs */
writel(0xffffffff, intc->base + (i * CHIP_SIZE) +
Expand All @@ -134,14 +142,11 @@ static int __init ingenic_intc_of_init(struct device_node *node,
IRQ_NOPROBE | IRQ_LEVEL);
}

domain = irq_domain_add_legacy(node, num_chips * 32, JZ4740_IRQ_BASE, 0,
&irq_domain_simple_ops, NULL);
if (!domain)
pr_warn("unable to register IRQ domain\n");

setup_irq(parent_irq, &intc_cascade_action);
return 0;

out_unmap_base:
iounmap(intc->base);
out_unmap_irq:
irq_dispose_mapping(parent_irq);
out_free:
Expand Down

0 comments on commit 0419ec2

Please sign in to comment.