Commit f042ebcf authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Stephen Boyd
Browse files

clk: axm5516: 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-2-lars@metafoo.de


Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent a301528f
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -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,