]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
regulator: mt6357: fix OF node reference imbalance
authorJohan Hovold <johan@kernel.org>
Wed, 8 Apr 2026 07:30:52 +0000 (09:30 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 9 Apr 2026 19:19:32 +0000 (20:19 +0100)
The driver reuses the OF node of the parent multi-function device but
fails to take another reference to balance the one dropped by the
platform bus code when unbinding the MFD and deregistering the child
devices.

Fix this by using the intended helper for reusing OF nodes.

Fixes: dafc7cde23dc ("regulator: add mt6357 regulator")
Cc: stable@vger.kernel.org # 6.2
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260408073055.5183-5-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/mt6357-regulator.c

index 1eb69c7a6acb38737ed933fbf046bf727b6a7abc..09feb454ab6b849d50f1b7f123766d9ae7e4fba5 100644 (file)
@@ -410,7 +410,7 @@ static int mt6357_regulator_probe(struct platform_device *pdev)
        struct regulator_dev *rdev;
        int i;
 
-       pdev->dev.of_node = pdev->dev.parent->of_node;
+       device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent);
 
        for (i = 0; i < MT6357_MAX_REGULATOR; i++) {
                config.dev = &pdev->dev;