On 4/7/25 4:36 AM, Biju Das wrote: > Simplify of_davinci_pll_init() by using of_get_available_child_by_name(). > > While at it, move of_node_put(child) inside the if block to avoid > additional check if of_child is NULL. > > Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx> > --- > v1->v2: > * Rebased to next as the dependency patch hits on 6.15-rc1. > --- Reviewed-by: David Lechner <david@xxxxxxxxxxxxxx> > drivers/clk/davinci/pll.c | 23 ++++++++++++----------- > 1 file changed, 12 insertions(+), 11 deletions(-) > > diff --git a/drivers/clk/davinci/pll.c b/drivers/clk/davinci/pll.c > index 6807a2efa93b..a236dfeccdb1 100644 > --- a/drivers/clk/davinci/pll.c > +++ b/drivers/clk/davinci/pll.c > @@ -763,13 +763,13 @@ int of_davinci_pll_init(struct device *dev, struct device_node *node, > return PTR_ERR(clk); > } > > - child = of_get_child_by_name(node, "pllout"); > - if (of_device_is_available(child)) > + child = of_get_available_child_by_name(node, "pllout"); > + if (child) > of_clk_add_provider(child, of_clk_src_simple_get, clk); > of_node_put(child); It is a bit odd to move the other of_node_put() inside the if but not this one.