Commit 03cc105f authored by Rob Herring's avatar Rob Herring

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: default avatarStephen Boyd <sboyd@kernel.org>
Reviewed-by: default avatarSudeep Holla <sudeep.holla@arm.com>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarLiviu Dudau <liviu.dudau@arm.com>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
parent 562bbb23
......@@ -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);
......
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