summaryrefslogtreecommitdiffstats
path: root/drivers/clk/clk-twl6040.c
diff options
context:
space:
mode:
authorStephen Boyd <stephen.boyd@linaro.org>2016-06-02 01:15:30 +0200
committerStephen Boyd <sboyd@codeaurora.org>2016-08-25 02:34:11 +0200
commitf5b3715ecf851da45f27e28120b9c5c9ddeccb5f (patch)
tree9e7c3064921f7a673f3e75f436a643647af92023 /drivers/clk/clk-twl6040.c
parentclk: si570: Migrate to clk_hw based OF and registration APIs (diff)
downloadlinux-f5b3715ecf851da45f27e28120b9c5c9ddeccb5f.tar.xz
linux-f5b3715ecf851da45f27e28120b9c5c9ddeccb5f.zip
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: Stephen Boyd <stephen.boyd@linaro.org> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/clk/clk-twl6040.c')
-rw-r--r--drivers/clk/clk-twl6040.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/clk/clk-twl6040.c b/drivers/clk/clk-twl6040.c
index c98b1ec76f54..7b222a5db931 100644
--- a/drivers/clk/clk-twl6040.c
+++ b/drivers/clk/clk-twl6040.c
@@ -30,7 +30,6 @@ struct twl6040_pdmclk {
struct twl6040 *twl6040;
struct device *dev;
struct clk_hw pdmclk_hw;
- struct clk *clk;
int enabled;
};
@@ -93,6 +92,7 @@ static int twl6040_pdmclk_probe(struct platform_device *pdev)
{
struct twl6040 *twl6040 = dev_get_drvdata(pdev->dev.parent);
struct twl6040_pdmclk *clkdata;
+ int ret;
clkdata = devm_kzalloc(&pdev->dev, sizeof(*clkdata), GFP_KERNEL);
if (!clkdata)
@@ -102,14 +102,15 @@ static int twl6040_pdmclk_probe(struct platform_device *pdev)
clkdata->twl6040 = twl6040;
clkdata->pdmclk_hw.init = &twl6040_pdmclk_init;
- clkdata->clk = devm_clk_register(&pdev->dev, &clkdata->pdmclk_hw);
- if (IS_ERR(clkdata->clk))
- return PTR_ERR(clkdata->clk);
+ ret = devm_clk_hw_register(&pdev->dev, &clkdata->pdmclk_hw);
+ if (ret)
+ return ret;
platform_set_drvdata(pdev, clkdata);
- return of_clk_add_provider(pdev->dev.parent->of_node,
- of_clk_src_simple_get, clkdata->clk);
+ return of_clk_add_hw_provider(pdev->dev.parent->of_node,
+ of_clk_hw_simple_get,
+ &clkdata->pdmclk_hw);
}
static struct platform_driver twl6040_pdmclk_driver = {