From: Rob Herring Date: Wed, 29 Apr 2020 20:58:15 +0000 (-0500) Subject: clk: vexpress-osc: Use the devres clock API variants X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=03cc105f2edfe2b95ffce56422c38862a23dbbd1;p=uclinux-h8%2Flinux.git clk: vexpress-osc: Use the devres clock API variants In preparation to enable the vexpress-osc clock driver as a module, convert the driver to use the managed devres clock API variants. With this, a driver .remove() hook is not needed. Cc: Lorenzo Pieralisi Cc: Linus Walleij Cc: linux-clk@vger.kernel.org Reviewed-by: Stephen Boyd Reviewed-by: Sudeep Holla Acked-by: Arnd Bergmann Acked-by: Liviu Dudau Signed-off-by: Rob Herring --- diff --git a/drivers/clk/versatile/clk-vexpress-osc.c b/drivers/clk/versatile/clk-vexpress-osc.c index 7ade146a3ea9..5bb1d5a714d0 100644 --- a/drivers/clk/versatile/clk-vexpress-osc.c +++ b/drivers/clk/versatile/clk-vexpress-osc.c @@ -65,8 +65,8 @@ static int vexpress_osc_probe(struct platform_device *pdev) { struct clk_init_data init; struct vexpress_osc *osc; - struct clk *clk; u32 range[2]; + int ret; osc = devm_kzalloc(&pdev->dev, sizeof(*osc), GFP_KERNEL); if (!osc) @@ -92,11 +92,11 @@ static int vexpress_osc_probe(struct platform_device *pdev) osc->hw.init = &init; - clk = clk_register(NULL, &osc->hw); - if (IS_ERR(clk)) - return PTR_ERR(clk); + ret = devm_clk_hw_register(&pdev->dev, &osc->hw); + if (ret < 0) + return ret; - of_clk_add_provider(pdev->dev.of_node, of_clk_src_simple_get, clk); + devm_of_clk_add_hw_provider(&pdev->dev, of_clk_hw_simple_get, &osc->hw); clk_hw_set_rate_range(&osc->hw, osc->rate_min, osc->rate_max); dev_dbg(&pdev->dev, "Registered clock '%s'\n", init.name);