]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
bus: tegra-aconnect: Use of_pm_clk_add_clk()
authorJon Hunter <jonathanh@nvidia.com>
Tue, 16 Aug 2016 10:17:36 +0000 (11:17 +0100)
committerThierry Reding <treding@nvidia.com>
Tue, 16 Aug 2016 10:22:51 +0000 (12:22 +0200)
Commit 498b5fdd40dd ("PM / clk: Add support for adding a specific clock
from device-tree") add a new helper function for adding a clock from
device-tree to a device. Update the Tegra ACONNECT driver to use this
new function to simplify the driver.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/bus/tegra-aconnect.c

index 7e4104b74fa8eb747a02f24a66d7e1c469941369..084ae286fa239472cc55bbd398c38d35d63fc8ac 100644 (file)
 #include <linux/pm_clock.h>
 #include <linux/pm_runtime.h>
 
-static int tegra_aconnect_add_clock(struct device *dev, char *name)
-{
-       struct clk *clk;
-       int ret;
-
-       clk = clk_get(dev, name);
-       if (IS_ERR(clk)) {
-               dev_err(dev, "%s clock not found\n", name);
-               return PTR_ERR(clk);
-       }
-
-       ret = pm_clk_add_clk(dev, clk);
-       if (ret)
-               clk_put(clk);
-
-       return ret;
-}
-
 static int tegra_aconnect_probe(struct platform_device *pdev)
 {
        int ret;
@@ -44,11 +26,11 @@ static int tegra_aconnect_probe(struct platform_device *pdev)
        if (ret)
                return ret;
 
-       ret = tegra_aconnect_add_clock(&pdev->dev, "ape");
+       ret = of_pm_clk_add_clk(&pdev->dev, "ape");
        if (ret)
                goto clk_destroy;
 
-       ret = tegra_aconnect_add_clock(&pdev->dev, "apb2ape");
+       ret = of_pm_clk_add_clk(&pdev->dev, "apb2ape");
        if (ret)
                goto clk_destroy;