Commit a301528f authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Stephen Boyd

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: default avatarLars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20230410014502.27929-1-lars@metafoo.deSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent ce1c5f84
...@@ -553,15 +553,10 @@ static int axi_clkgen_probe(struct platform_device *pdev) ...@@ -553,15 +553,10 @@ static int axi_clkgen_probe(struct platform_device *pdev)
if (ret) if (ret)
return ret; return ret;
return of_clk_add_hw_provider(pdev->dev.of_node, of_clk_hw_simple_get, return devm_of_clk_add_hw_provider(&pdev->dev, of_clk_hw_simple_get,
&axi_clkgen->clk_hw); &axi_clkgen->clk_hw);
} }
static void axi_clkgen_remove(struct platform_device *pdev)
{
of_clk_del_provider(pdev->dev.of_node);
}
static const struct of_device_id axi_clkgen_ids[] = { static const struct of_device_id axi_clkgen_ids[] = {
{ {
.compatible = "adi,zynqmp-axi-clkgen-2.00.a", .compatible = "adi,zynqmp-axi-clkgen-2.00.a",
...@@ -581,7 +576,6 @@ static struct platform_driver axi_clkgen_driver = { ...@@ -581,7 +576,6 @@ static struct platform_driver axi_clkgen_driver = {
.of_match_table = axi_clkgen_ids, .of_match_table = axi_clkgen_ids,
}, },
.probe = axi_clkgen_probe, .probe = axi_clkgen_probe,
.remove_new = axi_clkgen_remove,
}; };
module_platform_driver(axi_clkgen_driver); module_platform_driver(axi_clkgen_driver);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment