]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mfd: qcom-pm8xxx: Fix OF populate on driver rebind
authorJohan Hovold <johan@kernel.org>
Fri, 19 Dec 2025 11:09:47 +0000 (12:09 +0100)
committerLee Jones <lee@kernel.org>
Thu, 22 Jan 2026 14:23:38 +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: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://patch.msgid.link/20251219110947.24101-1-johan@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/qcom-pm8xxx.c

index 1149f7102a3656ac963784a2beed1a664fa3f776..0cf374c015ce7e791eeec6667ada07359c95c9cc 100644 (file)
@@ -577,17 +577,11 @@ static int pm8xxx_probe(struct platform_device *pdev)
        return rc;
 }
 
-static int pm8xxx_remove_child(struct device *dev, void *unused)
-{
-       platform_device_unregister(to_platform_device(dev));
-       return 0;
-}
-
 static void pm8xxx_remove(struct platform_device *pdev)
 {
        struct pm_irq_chip *chip = platform_get_drvdata(pdev);
 
-       device_for_each_child(&pdev->dev, NULL, pm8xxx_remove_child);
+       of_platform_depopulate(&pdev->dev);
        irq_domain_remove(chip->irqdomain);
 }