Skip to content

Commit 6c725f3

Browse files
avpatelKAGA-KOKO
authored andcommitted
irqchip/sifive-plic: Use riscv_get_intc_hwnode() to get parent fwnode
The RISC-V INTC irqdomain is always the parent irqdomain of SiFive PLIC so use riscv_get_intc_hwnode() to get the parent fwnode similar to other RISC-V drivers which use local interrupts. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20240222094006.1030709-5-apatel@ventanamicro.com
1 parent b68d0ff commit 6c725f3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/irqchip/irq-sifive-plic.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ static int plic_probe(struct platform_device *pdev)
423423
struct device *dev = &pdev->dev;
424424
unsigned long plic_quirks = 0;
425425
struct plic_handler *handler;
426+
struct irq_domain *domain;
426427
struct plic_priv *priv;
427428
bool cpuhp_setup;
428429
unsigned int cpu;
@@ -502,11 +503,11 @@ static int plic_probe(struct platform_device *pdev)
502503
}
503504

504505
/* Find parent domain and register chained handler */
505-
if (!plic_parent_irq && irq_find_host(parent.np)) {
506-
plic_parent_irq = irq_of_parse_and_map(to_of_node(dev->fwnode), i);
506+
domain = irq_find_matching_fwnode(riscv_get_intc_hwnode(), DOMAIN_BUS_ANY);
507+
if (!plic_parent_irq && domain) {
508+
plic_parent_irq = irq_create_mapping(domain, RV_IRQ_EXT);
507509
if (plic_parent_irq)
508-
irq_set_chained_handler(plic_parent_irq,
509-
plic_handle_irq);
510+
irq_set_chained_handler(plic_parent_irq, plic_handle_irq);
510511
}
511512

512513
/*

0 commit comments

Comments
 (0)