Re: [PATCH 1/3] regulator: max77650: fix OF node reference imbalance

From: Bartosz Golaszewski

Date: Tue Apr 07 2026 - 08:35:35 EST


On Tue, 7 Apr 2026 14:20:29 +0200, Johan Hovold <johan@xxxxxxxxxx> said:
> 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: bcc61f1c44fd ("regulator: max77650: add regulator support")
> Cc: stable@xxxxxxxxxxxxxxx # 5.1
> Cc: Bartosz Golaszewski <brgl@xxxxxxxxxx>
> Signed-off-by: Johan Hovold <johan@xxxxxxxxxx>
> ---
> drivers/regulator/max77650-regulator.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/regulator/max77650-regulator.c b/drivers/regulator/max77650-regulator.c
> index a809264c77fc..11b04a13f889 100644
> --- a/drivers/regulator/max77650-regulator.c
> +++ b/drivers/regulator/max77650-regulator.c
> @@ -337,7 +337,7 @@ static int max77650_regulator_probe(struct platform_device *pdev)
> parent = dev->parent;
>
> if (!dev->of_node)
> - dev->of_node = parent->of_node;
> + device_set_of_node_from_dev(dev, parent);
>
> rdescs = devm_kcalloc(dev, MAX77650_REGULATOR_NUM_REGULATORS,
> sizeof(*rdescs), GFP_KERNEL);
> --
> 2.52.0
>
>

Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>