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>
This commit is contained in:
parent
562bbb2335
commit
03cc105f2e
1 changed files with 5 additions and 5 deletions
|
@ -65,8 +65,8 @@ static int vexpress_osc_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct clk_init_data init;
|
struct clk_init_data init;
|
||||||
struct vexpress_osc *osc;
|
struct vexpress_osc *osc;
|
||||||
struct clk *clk;
|
|
||||||
u32 range[2];
|
u32 range[2];
|
||||||
|
int ret;
|
||||||
|
|
||||||
osc = devm_kzalloc(&pdev->dev, sizeof(*osc), GFP_KERNEL);
|
osc = devm_kzalloc(&pdev->dev, sizeof(*osc), GFP_KERNEL);
|
||||||
if (!osc)
|
if (!osc)
|
||||||
|
@ -92,11 +92,11 @@ static int vexpress_osc_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
osc->hw.init = &init;
|
osc->hw.init = &init;
|
||||||
|
|
||||||
clk = clk_register(NULL, &osc->hw);
|
ret = devm_clk_hw_register(&pdev->dev, &osc->hw);
|
||||||
if (IS_ERR(clk))
|
if (ret < 0)
|
||||||
return PTR_ERR(clk);
|
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);
|
clk_hw_set_rate_range(&osc->hw, osc->rate_min, osc->rate_max);
|
||||||
|
|
||||||
dev_dbg(&pdev->dev, "Registered clock '%s'\n", init.name);
|
dev_dbg(&pdev->dev, "Registered clock '%s'\n", init.name);
|
||||||
|
|
Loading…
Add table
Reference in a new issue