[PATCH 2/6] irqchip/armada-370-xp: Fix return check in IPI alloc

Adam Lackorzynski adam at l4re.org
Sat Jan 2 12:58:55 EST 2021


__irq_domain_alloc_irqs returns a negative error
code upon failure, not only 0. Also use irq_domain_alloc_irqs
to require less default arguments.

Signed-off-by: Adam Lackorzynski <adam at l4re.org>
---
 drivers/irqchip/irq-armada-370-xp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c
index 32938dfc0e46..b5e3aacdc2d1 100644
--- a/drivers/irqchip/irq-armada-370-xp.c
+++ b/drivers/irqchip/irq-armada-370-xp.c
@@ -430,9 +430,9 @@ static __init void armada_xp_ipi_init(struct device_node *node)
 		return;
 
 	irq_domain_update_bus_token(ipi_domain, DOMAIN_BUS_IPI);
-	base_ipi = __irq_domain_alloc_irqs(ipi_domain, -1, IPI_DOORBELL_END,
-					   NUMA_NO_NODE, NULL, false, NULL);
-	if (WARN_ON(!base_ipi))
+	base_ipi = irq_domain_alloc_irqs(ipi_domain, IPI_DOORBELL_END,
+					 NUMA_NO_NODE, NULL);
+	if (WARN_ON(base_ipi <= 0))
 		return;
 
 	set_smp_ipi_range(base_ipi, IPI_DOORBELL_END);
-- 
2.30.0.rc2




More information about the linux-arm-kernel mailing list