]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
staging: greybus: arche-platform: fix OF populate on driver rebind
authorJohan Hovold <johan@kernel.org>
Fri, 19 Dec 2025 10:59:28 +0000 (11:59 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Dec 2025 08:43:11 +0000 (09:43 +0100)
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: bc142bbb4ceb ("greybus: arche_platform: Remove child's platform device as part of _remove() fn")
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20251219105928.23329-4-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/greybus/arche-platform.c

index 7dcb33a6f2e3ad54511b0496b505240528011998..8aaff4e456607d131dc0df38e4f9a86341190e76 100644 (file)
@@ -553,22 +553,13 @@ err_device_remove:
        return ret;
 }
 
-static int arche_remove_child(struct device *dev, void *unused)
-{
-       struct platform_device *pdev = to_platform_device(dev);
-
-       platform_device_unregister(pdev);
-
-       return 0;
-}
-
 static void arche_platform_remove(struct platform_device *pdev)
 {
        struct arche_platform_drvdata *arche_pdata = platform_get_drvdata(pdev);
 
        unregister_pm_notifier(&arche_pdata->pm_notifier);
        device_remove_file(&pdev->dev, &dev_attr_state);
-       device_for_each_child(&pdev->dev, NULL, arche_remove_child);
+       of_platform_depopulate(&pdev->dev);
        arche_platform_poweroff_seq(arche_pdata);
 
        if (usb3613_hub_mode_ctrl(false))