Skip to contentSkip to conversation

bus/aconnect: Update driver to use of_pm_clk_add_clk

PATCH Applied Jon Hunter 2 participants 2 messages Aug 16, 2016 1 message not in the archive Tegra architecture support

lore
Share & tools
lore

Jon Hunter

author
#0 lore raw

PATCH 1/1 bus/aconnect: Update driver to 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 ACONNECT driver to use this new function to simplify the driver.

---
 drivers/bus/tegra-aconnect.c | 22 ++--------------------
 1 file changed, 2 insertions(+), 20 deletions(-)
drivers/bus/tegra-aconnect.c +2 -20
index 7e4104b74fa8..084ae286fa23 100644
@@ -15,24 +15,6 @@
 #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;
 
Signature · 1 line
2.1.4

A message that is not in the archive (sent off-list or not yet received): 1471342656-8367-1-git-send-email-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org

#2 lore raw
Quoted 9 lines · Jon Hunter

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 ACONNECT driver to use this new function to simplify the driver.

---
 drivers/bus/tegra-aconnect.c | 22 ++--------------------
 1 file changed, 2 insertions(+), 20 deletions(-)

Applied, thanks.

Thierry