Skip to content

Commit a301528

Browse files
larsclausenbebarino
authored andcommitted
clk: axi-clkgen: Use managed of_clk_add_hw_provider()
Use the managed `devm_of_clk_add_hw_provider()` instead of `of_clk_add_hw_provider()`. This makes sure the provider gets automatically removed on unbind and allows to completely eliminate the drivers `remove()` callback. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Link: https://lore.kernel.org/r/20230410014502.27929-1-lars@metafoo.de Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent ce1c5f8 commit a301528

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

drivers/clk/clk-axi-clkgen.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -553,13 +553,8 @@ static int axi_clkgen_probe(struct platform_device *pdev)
553553
if (ret)
554554
return ret;
555555

556-
return of_clk_add_hw_provider(pdev->dev.of_node, of_clk_hw_simple_get,
557-
&axi_clkgen->clk_hw);
558-
}
559-
560-
static void axi_clkgen_remove(struct platform_device *pdev)
561-
{
562-
of_clk_del_provider(pdev->dev.of_node);
556+
return devm_of_clk_add_hw_provider(&pdev->dev, of_clk_hw_simple_get,
557+
&axi_clkgen->clk_hw);
563558
}
564559

565560
static const struct of_device_id axi_clkgen_ids[] = {
@@ -581,7 +576,6 @@ static struct platform_driver axi_clkgen_driver = {
581576
.of_match_table = axi_clkgen_ids,
582577
},
583578
.probe = axi_clkgen_probe,
584-
.remove_new = axi_clkgen_remove,
585579
};
586580
module_platform_driver(axi_clkgen_driver);
587581

0 commit comments

Comments
 (0)