aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/omap_device.c
diff options
context:
space:
mode:
authorTero Kristo <t-kristo@ti.com>2016-06-30 09:14:59 -0400
committerTony Lindgren <tony@atomide.com>2016-07-04 02:42:53 -0400
commit59dcfc48eb41c9074938fc2a0a07634e60f08e22 (patch)
tree3ce862ce427461a2fc428596c756428d8922cffa /arch/arm/mach-omap2/omap_device.c
parentb3bf289c1c4561b4262084b64d1a115e4ba845cf (diff)
ARM: OMAP2+: omap_device: create clock alias purely from DT data
This avoids the need to add most of the clock aliases under drivers/clk/ti/clk-xyz.c files. Signed-off-by: Tero Kristo <t-kristo@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/omap_device.c')
-rw-r--r--arch/arm/mach-omap2/omap_device.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c
index a7be05d83ec7..c2626f83e0c2 100644
--- a/arch/arm/mach-omap2/omap_device.c
+++ b/arch/arm/mach-omap2/omap_device.c
@@ -63,7 +63,22 @@ static void _add_clkdev(struct omap_device *od, const char *clk_alias,
63 return; 63 return;
64 } 64 }
65 65
66 rc = clk_add_alias(clk_alias, dev_name(&od->pdev->dev), clk_name, NULL); 66 r = clk_get_sys(NULL, clk_name);
67
68 if (IS_ERR(r) && of_have_populated_dt()) {
69 struct of_phandle_args clkspec;
70
71 clkspec.np = of_find_node_by_name(NULL, clk_name);
72
73 r = of_clk_get_from_provider(&clkspec);
74
75 rc = clk_register_clkdev(r, clk_alias,
76 dev_name(&od->pdev->dev));
77 } else {
78 rc = clk_add_alias(clk_alias, dev_name(&od->pdev->dev),
79 clk_name, NULL);
80 }
81
67 if (rc) { 82 if (rc) {
68 if (rc == -ENODEV || rc == -ENOMEM) 83 if (rc == -ENODEV || rc == -ENOMEM)
69 dev_err(&od->pdev->dev, 84 dev_err(&od->pdev->dev,