summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/omap_device.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2016-07-07 14:34:43 +0200
committerArnd Bergmann <arnd@arndb.de>2016-07-07 14:34:43 +0200
commit04b6d0a30082836741c60db6150bcdc73c95afaa (patch)
tree08decec6687debde513fafca862575e0f742d0b8 /arch/arm/mach-omap2/omap_device.c
parentc341376ae9b86f67406e1adb7216e6932d8db34c (diff)
parent183e2077d007aa4b697efba095ecfea7244a6107 (diff)
downloadlinux-04b6d0a30082836741c60db6150bcdc73c95afaa.tar.bz2
Merge tag 'omap-for-v4.8/soc-pt2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/soc
Merge "Few more omap SoC changes for v4.8 merge window" from Tony Lindgren: - Fix a make randconfig build error for recent SMP kexec changes - A series of clock related fixes to prepare things for moving device clkctrl register handling to drivers/clk * tag 'omap-for-v4.8/soc-pt2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: AM33xx: fix module_wait_ready without clkctrl register ARM: OMAP2+: clockdomain: add usecounting support to autoidle APIs ARM: OMAP2+: timer: change order of hwmod data handling ARM: OMAP2+: hwmod: fetch main_clk based on hwmod name ARM: OMAP2+: omap_device: create clock alias purely from DT data ARM: OMAP2+: Fix build with CONFIG_SMP and CONFIG_PM is not set
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,
return;
}
- rc = clk_add_alias(clk_alias, dev_name(&od->pdev->dev), clk_name, NULL);
+ r = clk_get_sys(NULL, clk_name);
+
+ if (IS_ERR(r) && of_have_populated_dt()) {
+ struct of_phandle_args clkspec;
+
+ clkspec.np = of_find_node_by_name(NULL, clk_name);
+
+ r = of_clk_get_from_provider(&clkspec);
+
+ rc = clk_register_clkdev(r, clk_alias,
+ dev_name(&od->pdev->dev));
+ } else {
+ rc = clk_add_alias(clk_alias, dev_name(&od->pdev->dev),
+ clk_name, NULL);
+ }
+
if (rc) {
if (rc == -ENODEV || rc == -ENOMEM)
dev_err(&od->pdev->dev,