[PATCH 7/8] irqchip/imx-intmux: Use devm_irq_domain_create_linear()

Peng Fan peng.fan at linux.dev
Mon Nov 16 23:14:11 PST 2026


From: Peng Fan <peng.fan at nxp.com>

Manage the per-channel IRQ domains with devres so that they are removed
automatically when probe fails or the driver is unbound, instead of
calling irq_domain_remove() explicitly in the probe error path and in
imx_intmux_remove().

The child mappings are still disposed explicitly before the domains go
away. devres runs after imx_intmux_remove(), so each domain is removed
with an empty reverse map, and the domains are torn down before the IPG
clock devres action disables the clock.

No functional change.

Signed-off-by: Peng Fan <peng.fan at nxp.com>
---
 drivers/irqchip/irq-imx-intmux.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/irqchip/irq-imx-intmux.c b/drivers/irqchip/irq-imx-intmux.c
index 755c07007390..1f6e5d9c797a 100644
--- a/drivers/irqchip/irq-imx-intmux.c
+++ b/drivers/irqchip/irq-imx-intmux.c
@@ -248,8 +248,9 @@ static int imx_intmux_probe(struct platform_device *pdev)
 			goto out;
 		}
 
-		domain = irq_domain_create_linear(of_fwnode_handle(np), 32, &imx_intmux_domain_ops,
-					       &data->irqchip_data[i]);
+		domain = devm_irq_domain_create_linear(&pdev->dev, dev_fwnode(&pdev->dev), 32,
+						       &imx_intmux_domain_ops,
+						       &data->irqchip_data[i]);
 		if (!domain) {
 			ret = -ENOMEM;
 			dev_err(&pdev->dev, "failed to create IRQ domain\n");
@@ -283,7 +284,6 @@ static int imx_intmux_probe(struct platform_device *pdev)
 		for (unsigned int hwirq = 0; hwirq < 32; hwirq++)
 			irq_dispose_mapping(irq_find_mapping(data->irqchip_data[i].domain,
 							     hwirq));
-		irq_domain_remove(data->irqchip_data[i].domain);
 		irq_dispose_mapping(data->irqchip_data[i].irq);
 	}
 	pm_runtime_disable(&pdev->dev);
@@ -309,7 +309,6 @@ static void imx_intmux_remove(struct platform_device *pdev)
 		for (unsigned int hwirq = 0; hwirq < 32; hwirq++)
 			irq_dispose_mapping(irq_find_mapping(data->irqchip_data[i].domain,
 							     hwirq));
-		irq_domain_remove(data->irqchip_data[i].domain);
 		irq_dispose_mapping(data->irqchip_data[i].irq);
 	}
 

-- 
2.56.0




More information about the linux-arm-kernel mailing list