]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
regulator: bd9571mwv: fix OF node reference imbalance
authorJohan Hovold <johan@kernel.org>
Wed, 8 Apr 2026 07:30:55 +0000 (09:30 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 9 Apr 2026 19:19:35 +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: e85c5a153fe2 ("regulator: Add ROHM BD9571MWV-M PMIC regulator driver")
Cc: stable@vger.kernel.org # 4.12
Cc: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260408073055.5183-8-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/bd9571mwv-regulator.c

index 209beabb5c37c6e2d6582276920c9f3dfe33e200..f4de24a281b123984b6a67e28fd00ff16e5ac564 100644 (file)
@@ -287,8 +287,9 @@ static int bd9571mwv_regulator_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, bdreg);
 
+       device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent);
+
        config.dev = &pdev->dev;
-       config.dev->of_node = pdev->dev.parent->of_node;
        config.driver_data = bdreg;
        config.regmap = bdreg->regmap;