Re: [PATCH] clk: rk808: fix OF node reference imbalance

From: Heiko Stuebner

Date: Mon Apr 27 2026 - 07:17:59 EST


Am Samstag, 25. April 2026, 20:10:27 Mitteleuropäische Sommerzeit schrieb Stephen Boyd:
> Quoting Johan Hovold (2026-04-07 02:50:27)
> > 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: 2dc51ca822e4 ("clk: RK808: Reduce 'struct rk808' usage")
> > Cc: stable@xxxxxxxxxxxxxxx # 6.5
> > Cc: Sebastian Reichel <sebastian.reichel@xxxxxxxxxxxxx>
> > Signed-off-by: Johan Hovold <johan@xxxxxxxxxx>
> > ---
>
> +Heiko

Looking at the device_set_of_node_from_dev() function, this is the
right move, so

Reviewed-by: Heiko Stuebner <heiko@xxxxxxxxx>


It also seems the rk808-regulator.c might be another candidate for
this, as it also takes the node without of_node_get and manually
setting the of_node_reused flag.


Heiko


> > drivers/clk/clk-rk808.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/clk/clk-rk808.c b/drivers/clk/clk-rk808.c
> > index f7412b137e5e..5a75b5c91555 100644
> > --- a/drivers/clk/clk-rk808.c
> > +++ b/drivers/clk/clk-rk808.c
> > @@ -153,7 +153,7 @@ static int rk808_clkout_probe(struct platform_device *pdev)
> > struct rk808_clkout *rk808_clkout;
> > int ret;
> >
> > - dev->of_node = pdev->dev.parent->of_node;
> > + device_set_of_node_from_dev(dev, dev->parent);
> >
> > rk808_clkout = devm_kzalloc(dev,
> > sizeof(*rk808_clkout), GFP_KERNEL);
> >
>