diff options
author | Jon Hunter <jonathanh@nvidia.com> | 2016-08-16 06:17:36 -0400 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2016-08-16 06:22:51 -0400 |
commit | 3a99cb090b523f88d0a19598d39704afac11adcb (patch) | |
tree | 447dc7e1005906d02e37261936f58b67983182f3 | |
parent | 2d301c0721f59d20bb82a901ba8fad7b74c95728 (diff) |
bus: tegra-aconnect: Use of_pm_clk_add_clk()
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>
-rw-r--r-- | drivers/bus/tegra-aconnect.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/drivers/bus/tegra-aconnect.c b/drivers/bus/tegra-aconnect.c index 7e4104b74fa8..084ae286fa23 100644 --- a/drivers/bus/tegra-aconnect.c +++ b/drivers/bus/tegra-aconnect.c | |||
@@ -15,24 +15,6 @@ | |||
15 | #include <linux/pm_clock.h> | 15 | #include <linux/pm_clock.h> |
16 | #include <linux/pm_runtime.h> | 16 | #include <linux/pm_runtime.h> |
17 | 17 | ||
18 | static int tegra_aconnect_add_clock(struct device *dev, char *name) | ||
19 | { | ||
20 | struct clk *clk; | ||
21 | int ret; | ||
22 | |||
23 | clk = clk_get(dev, name); | ||
24 | if (IS_ERR(clk)) { | ||
25 | dev_err(dev, "%s clock not found\n", name); | ||
26 | return PTR_ERR(clk); | ||
27 | } | ||
28 | |||
29 | ret = pm_clk_add_clk(dev, clk); | ||
30 | if (ret) | ||
31 | clk_put(clk); | ||
32 | |||
33 | return ret; | ||
34 | } | ||
35 | |||
36 | static int tegra_aconnect_probe(struct platform_device *pdev) | 18 | static int tegra_aconnect_probe(struct platform_device *pdev) |
37 | { | 19 | { |
38 | int ret; | 20 | int ret; |
@@ -44,11 +26,11 @@ static int tegra_aconnect_probe(struct platform_device *pdev) | |||
44 | if (ret) | 26 | if (ret) |
45 | return ret; | 27 | return ret; |
46 | 28 | ||
47 | ret = tegra_aconnect_add_clock(&pdev->dev, "ape"); | 29 | ret = of_pm_clk_add_clk(&pdev->dev, "ape"); |
48 | if (ret) | 30 | if (ret) |
49 | goto clk_destroy; | 31 | goto clk_destroy; |
50 | 32 | ||
51 | ret = tegra_aconnect_add_clock(&pdev->dev, "apb2ape"); | 33 | ret = of_pm_clk_add_clk(&pdev->dev, "apb2ape"); |
52 | if (ret) | 34 | if (ret) |
53 | goto clk_destroy; | 35 | goto clk_destroy; |
54 | 36 | ||