diff mbox series

[02/11] clk: axm5516: Use managed `of_clk_add_hw_provider()`

Message ID 20230410014502.27929-2-lars@metafoo.de (mailing list archive)
State Accepted, archived
Headers show
Series [01/11] clk: axi-clkgen: Use managed `of_clk_add_hw_provider()` | expand

Commit Message

Lars-Peter Clausen April 10, 2023, 1:44 a.m. UTC
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>
---
 drivers/clk/clk-axm5516.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

Stephen Boyd April 10, 2023, 7:58 p.m. UTC | #1
Quoting Lars-Peter Clausen (2023-04-09 18:44:53)
> 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>
> ---

Applied to clk-next
diff mbox series

Patch

diff --git a/drivers/clk/clk-axm5516.c b/drivers/clk/clk-axm5516.c
index 1dff2017ad9d..1afcfdf2e6f9 100644
--- a/drivers/clk/clk-axm5516.c
+++ b/drivers/clk/clk-axm5516.c
@@ -569,17 +569,11 @@  static int axmclk_probe(struct platform_device *pdev)
 			return ret;
 	}
 
-	return of_clk_add_hw_provider(dev->of_node, of_clk_axmclk_get, NULL);
-}
-
-static void axmclk_remove(struct platform_device *pdev)
-{
-	of_clk_del_provider(pdev->dev.of_node);
+	return devm_of_clk_add_hw_provider(dev, of_clk_axmclk_get, NULL);
 }
 
 static struct platform_driver axmclk_driver = {
 	.probe		= axmclk_probe,
-	.remove_new	= axmclk_remove,
 	.driver		= {
 		.name	= "clk-axm5516",
 		.of_match_table = axmclk_match_table,