]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mfd: omap-usb-host: Fix OF populate on driver rebind
authorJohan Hovold <johan@kernel.org>
Fri, 19 Dec 2025 11:07:14 +0000 (12:07 +0100)
committerLee Jones <lee@kernel.org>
Thu, 22 Jan 2026 14:23:40 +0000 (14:23 +0000)
Since commit c6e126de43e7 ("of: Keep track of populated platform
devices") child devices will not be created by of_platform_populate()
if the devices had previously been deregistered individually so that the
OF_POPULATED flag is still set in the corresponding OF nodes.

Switch to using of_platform_depopulate() instead of open coding so that
the child devices are created if the driver is rebound.

Fixes: c6e126de43e7 ("of: Keep track of populated platform devices")
Cc: stable@vger.kernel.org # 3.16
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Andreas Kemnade <andreas@kemnade.info>
Link: https://patch.msgid.link/20251219110714.23919-1-johan@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/omap-usb-host.c

index a77b6fc790f2e06f086b6ecd107317aa4231c344..4d29a6e2ed87abf2a0f6d5a704525baaa6f0cbcb 100644 (file)
@@ -819,8 +819,10 @@ static void usbhs_omap_remove(struct platform_device *pdev)
 {
        pm_runtime_disable(&pdev->dev);
 
-       /* remove children */
-       device_for_each_child(&pdev->dev, NULL, usbhs_omap_remove_child);
+       if (pdev->dev.of_node)
+               of_platform_depopulate(&pdev->dev);
+       else
+               device_for_each_child(&pdev->dev, NULL, usbhs_omap_remove_child);
 }
 
 static const struct dev_pm_ops usbhsomap_dev_pm_ops = {