]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mailbox: imx: use devm_of_platform_populate()
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Wed, 17 Jun 2026 06:55:29 +0000 (08:55 +0200)
committerJassi Brar <jassisinghbrar@gmail.com>
Sun, 21 Jun 2026 02:18:38 +0000 (21:18 -0500)
The driver uses of_platform_populate() but does not remove the added
devices on removal. This can lead to "double devices" on module removal
followed by adding the module again.

Use devm_of_platform_populate() to remove the populated devices once the
parent device is removed.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
drivers/mailbox/imx-mailbox.c

index 516a05b64daa1213948a2bd63991641c5ac02091..a8d4e970fb78657f064e3b1c53813ae55a6aa617 100644 (file)
@@ -984,7 +984,7 @@ static int imx_mu_probe(struct platform_device *pdev)
        if (ret)
                goto err_out;
 
-       of_platform_populate(dev->of_node, NULL, NULL, dev);
+       devm_of_platform_populate(dev);
 
        return 0;