summaryrefslogtreecommitdiff
path: root/drivers/clk/ti/clk-dra7-atl.c
diff options
context:
space:
mode:
authorTero Kristo <t-kristo@ti.com>2016-09-29 12:06:40 +0300
committerTero Kristo <t-kristo@ti.com>2017-03-08 12:58:18 +0200
commit1ae79c46cf195ea39407bd5a2b234304d537980f (patch)
treec54b41385bc0fcd1faf55a98851ac765bf65cf9e /drivers/clk/ti/clk-dra7-atl.c
parentc17435c56bb1feb7365ebffcfbe98baae50a0fb4 (diff)
clk: ti: use automatic clock alias generation framework
Generate clock aliases automatically for all TI clock drivers. Signed-off-by: Tero Kristo <t-kristo@ti.com> Acked-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'drivers/clk/ti/clk-dra7-atl.c')
-rw-r--r--drivers/clk/ti/clk-dra7-atl.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/clk/ti/clk-dra7-atl.c b/drivers/clk/ti/clk-dra7-atl.c
index 45d05339d583..13eb04f72389 100644
--- a/drivers/clk/ti/clk-dra7-atl.c
+++ b/drivers/clk/ti/clk-dra7-atl.c
@@ -24,6 +24,9 @@
#include <linux/of_address.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
+#include <linux/clk/ti.h>
+
+#include "clock.h"
#define DRA7_ATL_INSTANCES 4
@@ -171,6 +174,7 @@ static void __init of_dra7_atl_clock_setup(struct device_node *node)
struct clk_init_data init = { NULL };
const char **parent_names = NULL;
struct clk *clk;
+ int ret;
clk_hw = kzalloc(sizeof(*clk_hw), GFP_KERNEL);
if (!clk_hw) {
@@ -200,9 +204,14 @@ static void __init of_dra7_atl_clock_setup(struct device_node *node)
init.parent_names = parent_names;
- clk = clk_register(NULL, &clk_hw->hw);
+ clk = ti_clk_register(NULL, &clk_hw->hw, node->name);
if (!IS_ERR(clk)) {
+ ret = ti_clk_add_alias(NULL, clk, node->name);
+ if (ret) {
+ clk_unregister(clk);
+ goto cleanup;
+ }
of_clk_add_provider(node, of_clk_src_simple_get, clk);
kfree(parent_names);
return;