Skip to content

Commit

Permalink
irqchip/sifive-plic: Use riscv_get_intc_hwnode() to get parent fwnode
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Anup Patel authored and Thomas Gleixner committed Feb 23, 2024
1 parent b68d0ff commit 6c725f3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/irqchip/irq-sifive-plic.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ static int plic_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
unsigned long plic_quirks = 0;
struct plic_handler *handler;
struct irq_domain *domain;
struct plic_priv *priv;
bool cpuhp_setup;
unsigned int cpu;
Expand Down Expand Up @@ -502,11 +503,11 @@ static int plic_probe(struct platform_device *pdev)
}

/* Find parent domain and register chained handler */
if (!plic_parent_irq && irq_find_host(parent.np)) {
plic_parent_irq = irq_of_parse_and_map(to_of_node(dev->fwnode), i);
domain = irq_find_matching_fwnode(riscv_get_intc_hwnode(), DOMAIN_BUS_ANY);
if (!plic_parent_irq && domain) {
plic_parent_irq = irq_create_mapping(domain, RV_IRQ_EXT);
if (plic_parent_irq)
irq_set_chained_handler(plic_parent_irq,
plic_handle_irq);
irq_set_chained_handler(plic_parent_irq, plic_handle_irq);
}

/*
Expand Down

0 comments on commit 6c725f3

Please sign in to comment.