From: Nishanth Menon <[email protected]>

clk_get does a check to find nodes on DT prior to trying clk_get_sys.

To make omap_device dt clock node aware, use clk_get instead of
clk_get_sys.

As part of this, add warnings for device node entries which do not
declare their own clock nodes for the expected aliases.

Signed-off-by: Nishanth Menon <[email protected]>
Signed-off-by: Tero Kristo <[email protected]>
---
 arch/arm/mach-omap2/omap_device.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_device.c 
b/arch/arm/mach-omap2/omap_device.c
index 7c796e2..9946900 100644
--- a/arch/arm/mach-omap2/omap_device.c
+++ b/arch/arm/mach-omap2/omap_device.c
@@ -48,19 +48,25 @@ static void _add_clkdev(struct omap_device *od, const char 
*clk_alias,
        int ret;
        struct clk *r;
        struct device *dev = &od->pdev->dev;
+       struct device_node *node = dev->of_node;
 
        if (!clk_alias || !clk_name)
                return;
 
        dev_dbg(dev, "Creating %s -> %s\n", clk_alias, clk_name);
 
-       r = clk_get_sys(dev_name(dev), clk_alias);
+       r = clk_get(dev, clk_alias);
        if (!IS_ERR(r)) {
-               dev_warn(dev, "alias %s already exists\n", clk_alias);
+               if (!node)
+                       dev_warn(dev, "alias '%s' already exists\n", clk_alias);
                clk_put(r);
                return;
        }
 
+       if (node)
+               dev_err(dev, "FIXME: clock-name '%s' DOES NOT exist in dt!\n",
+                       clk_alias);
+
        ret = clk_add_alias(clk_alias, dev_name(dev), (char *)clk_name, dev);
        if (ret)
                dev_err(dev, "Failed to alias %s to %s: %d\n", clk_alias,
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to