Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-clk@vger.kernel.org
Reviewed-by: Stephen Boyd <sboyd@kernel.org>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Liviu Dudau <liviu.dudau@arm.com>
Signed-off-by: Rob Herring <robh@kernel.org>

+5 -5
+5 -5
drivers/clk/versatile/clk-vexpress-osc.c
··· 65 65 { 66 66 struct clk_init_data init; 67 67 struct vexpress_osc *osc; 68 - struct clk *clk; 69 68 u32 range[2]; 69 + int ret; 70 70 71 71 osc = devm_kzalloc(&pdev->dev, sizeof(*osc), GFP_KERNEL); 72 72 if (!osc) ··· 92 92 93 93 osc->hw.init = &init; 94 94 95 - clk = clk_register(NULL, &osc->hw); 96 - if (IS_ERR(clk)) 97 - return PTR_ERR(clk); 95 + ret = devm_clk_hw_register(&pdev->dev, &osc->hw); 96 + if (ret < 0) 97 + return ret; 98 98 99 - of_clk_add_provider(pdev->dev.of_node, of_clk_src_simple_get, clk); 99 + devm_of_clk_add_hw_provider(&pdev->dev, of_clk_hw_simple_get, &osc->hw); 100 100 clk_hw_set_rate_range(&osc->hw, osc->rate_min, osc->rate_max); 101 101 102 102 dev_dbg(&pdev->dev, "Registered clock '%s'\n", init.name);