Commit f5b3715e authored by Stephen Boyd's avatar Stephen Boyd Committed by Stephen Boyd

clk: twl6040: Migrate to clk_hw based registration APIs

Now that we have clk_hw based provider APIs to register clks, we
can get rid of struct clk pointers while registering clks in
these drivers, allowing us to move closer to a clear split of
consumer and provider clk APIs.

Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: default avatarStephen Boyd <stephen.boyd@linaro.org>
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent a340dae9
...@@ -30,7 +30,6 @@ struct twl6040_pdmclk { ...@@ -30,7 +30,6 @@ struct twl6040_pdmclk {
struct twl6040 *twl6040; struct twl6040 *twl6040;
struct device *dev; struct device *dev;
struct clk_hw pdmclk_hw; struct clk_hw pdmclk_hw;
struct clk *clk;
int enabled; int enabled;
}; };
...@@ -93,6 +92,7 @@ static int twl6040_pdmclk_probe(struct platform_device *pdev) ...@@ -93,6 +92,7 @@ static int twl6040_pdmclk_probe(struct platform_device *pdev)
{ {
struct twl6040 *twl6040 = dev_get_drvdata(pdev->dev.parent); struct twl6040 *twl6040 = dev_get_drvdata(pdev->dev.parent);
struct twl6040_pdmclk *clkdata; struct twl6040_pdmclk *clkdata;
int ret;
clkdata = devm_kzalloc(&pdev->dev, sizeof(*clkdata), GFP_KERNEL); clkdata = devm_kzalloc(&pdev->dev, sizeof(*clkdata), GFP_KERNEL);
if (!clkdata) if (!clkdata)
...@@ -102,14 +102,15 @@ static int twl6040_pdmclk_probe(struct platform_device *pdev) ...@@ -102,14 +102,15 @@ static int twl6040_pdmclk_probe(struct platform_device *pdev)
clkdata->twl6040 = twl6040; clkdata->twl6040 = twl6040;
clkdata->pdmclk_hw.init = &twl6040_pdmclk_init; clkdata->pdmclk_hw.init = &twl6040_pdmclk_init;
clkdata->clk = devm_clk_register(&pdev->dev, &clkdata->pdmclk_hw); ret = devm_clk_hw_register(&pdev->dev, &clkdata->pdmclk_hw);
if (IS_ERR(clkdata->clk)) if (ret)
return PTR_ERR(clkdata->clk); return ret;
platform_set_drvdata(pdev, clkdata); platform_set_drvdata(pdev, clkdata);
return of_clk_add_provider(pdev->dev.parent->of_node, return of_clk_add_hw_provider(pdev->dev.parent->of_node,
of_clk_src_simple_get, clkdata->clk); of_clk_hw_simple_get,
&clkdata->pdmclk_hw);
} }
static struct platform_driver twl6040_pdmclk_driver = { static struct platform_driver twl6040_pdmclk_driver = {
......
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