[PATCH] soc: mediatek: pwrap: Use devm_of_platform_populate()
Chen-Yu Tsai
wenst at chromium.org
Tue Nov 10 05:28:05 PST 2026
Most of the resource management calls in the driver's probe function
have been converted to the devres variants. However of_platform_populate()
has been left alone since the introduction of this driver.
Leaving the child PMIC populated while all the resources used by its
driver to access the PMIC's registers have been removed or turned off
makes no sense. The first step in the teardown should be to remove the
child devices.
This change is more for correctness. If someone manages to remove the
pwrap driver, bad things are going to happen whether the PMIC device
is still registered or not. If the PMIC device is still around, it is
left holding onto a regmap that was torn down.
Fixes: 1f022d84bd19 ("soc: mediatek: Add PMIC wrapper for MT8135 and MT8173 SoCs")
Signed-off-by: Chen-Yu Tsai <wenst at chromium.org>
---
drivers/soc/mediatek/mtk-pmic-wrap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c
index 90677187c3b5..fefe7a41da5a 100644
--- a/drivers/soc/mediatek/mtk-pmic-wrap.c
+++ b/drivers/soc/mediatek/mtk-pmic-wrap.c
@@ -2592,7 +2592,7 @@ static int pwrap_probe(struct platform_device *pdev)
if (IS_ERR(wrp->regmap))
return PTR_ERR(wrp->regmap);
- ret = of_platform_populate(np, NULL, NULL, wrp->dev);
+ ret = devm_of_platform_populate(wrp->dev);
if (ret) {
dev_dbg(wrp->dev, "failed to create child devices at %pOF\n",
np);
--
2.56.0.506.g506a7eabc5-goog
More information about the Linux-mediatek
mailing list