[PATCH 8/8] irqchip/imx-intmux: Use devm_pm_runtime_set_active_enabled()
From: Peng Fan
Date: Tue Nov 17 2026 - 02:15:40 EST
From: Peng Fan <peng.fan@xxxxxxx>
Use devm_pm_runtime_set_active_enabled() to manage the runtime PM
enablement instead of calling pm_runtime_set_active() and
pm_runtime_enable() manually. The devres actions then disable runtime PM
and mark the device suspended when probe fails or the driver is unbound.
Keep the explicit pm_runtime_get_noresume()/pm_runtime_put() pair so the
device is still suspended immediately after a successful probe, and keep
pm_runtime_put_noidle() in remove() to drop the reference acquired by
pm_runtime_resume_and_get().
The devres teardown runs after imx_intmux_remove() and disables runtime
PM before marking the device suspended, which is the order required by
the PM core. The IPG clock devres action still disables the clock last.
Signed-off-by: Peng Fan <peng.fan@xxxxxxx>
---
drivers/irqchip/irq-imx-intmux.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/irqchip/irq-imx-intmux.c b/drivers/irqchip/irq-imx-intmux.c
index 1f6e5d9c797a..770656ef10ec 100644
--- a/drivers/irqchip/irq-imx-intmux.c
+++ b/drivers/irqchip/irq-imx-intmux.c
@@ -234,9 +234,11 @@ static int imx_intmux_probe(struct platform_device *pdev)
data->channum = channum;
raw_spin_lock_init(&data->lock);
+ ret = devm_pm_runtime_set_active_enabled(&pdev->dev);
+ if (ret)
+ return ret;
+
pm_runtime_get_noresume(&pdev->dev);
- pm_runtime_set_active(&pdev->dev);
- pm_runtime_enable(&pdev->dev);
for (i = 0; i < channum; i++) {
data->irqchip_data[i].chanidx = i;
@@ -286,7 +288,6 @@ static int imx_intmux_probe(struct platform_device *pdev)
hwirq));
irq_dispose_mapping(data->irqchip_data[i].irq);
}
- pm_runtime_disable(&pdev->dev);
pm_runtime_put_noidle(&pdev->dev);
return ret;
}
@@ -312,11 +313,8 @@ static void imx_intmux_remove(struct platform_device *pdev)
irq_dispose_mapping(data->irqchip_data[i].irq);
}
- pm_runtime_disable(&pdev->dev);
- if (ret >= 0) {
+ if (ret >= 0)
pm_runtime_put_noidle(&pdev->dev);
- pm_runtime_set_suspended(&pdev->dev);
- }
}
#ifdef CONFIG_PM
--
2.56.0