[PATCH v7 1/2] bus: simple-pm-bus: Remove child devices when the bus is unbound

From: Herve Codina

Date: Mon May 11 2026 - 12:27:53 EST


During its probe, the simple-pm-bus driver (simple-pm-bus compatible
variant) populates its child devices but it doesn't touch them during
its removal.

This leads to bus child devices present and bound to drivers whereas the
bus itself is unbound.

Be consistent and remove child devices when the bus itself is unbound.

Signed-off-by: Herve Codina <herve.codina@xxxxxxxxxxx>
---
drivers/bus/simple-pm-bus.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/bus/simple-pm-bus.c b/drivers/bus/simple-pm-bus.c
index c920bd6fbaaf..4b2a793dfbd9 100644
--- a/drivers/bus/simple-pm-bus.c
+++ b/drivers/bus/simple-pm-bus.c
@@ -83,6 +83,9 @@ static void simple_pm_bus_remove(struct platform_device *pdev)

dev_dbg(&pdev->dev, "%s\n", __func__);

+ if (pdev->dev.of_node)
+ of_platform_depopulate(&pdev->dev);
+
pm_runtime_disable(&pdev->dev);
}

--
2.54.0