[PATCH v2 7/8] irqchip/imx-intmux: Use devm_irq_domain_create_linear()
Peng Fan
peng.fan at linux.dev
Thu Dec 3 01:29:19 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() and after the probe error
path returns, so each domain is removed with an empty reverse map once
the IPG clock is no longer in use. The clock has no managed disable
action.
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 369132b4677b..eeba45f312be 100644
--- a/drivers/irqchip/irq-imx-intmux.c
+++ b/drivers/irqchip/irq-imx-intmux.c
@@ -260,8 +260,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");
@@ -301,7 +302,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);
@@ -335,7 +335,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