From: Nishanth Menon <nm@xxxxxx> When we create aliases, we have an handy clk_add_alias which can be used instead of creating new nodes in the clock tree. Signed-off-by: Nishanth Menon <nm@xxxxxx> Signed-off-by: Tero Kristo <t-kristo@xxxxxx> --- arch/arm/mach-omap2/omap_device.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c index 070d17b..7c796e2 100644 --- a/arch/arm/mach-omap2/omap_device.c +++ b/arch/arm/mach-omap2/omap_device.c @@ -45,8 +45,8 @@ static void _add_clkdev(struct omap_device *od, const char *clk_alias, const char *clk_name) { + int ret; struct clk *r; - struct clk_lookup *l; struct device *dev = &od->pdev->dev; if (!clk_alias || !clk_name) @@ -61,19 +61,10 @@ static void _add_clkdev(struct omap_device *od, const char *clk_alias, return; } - r = clk_get(NULL, clk_name); - if (IS_ERR(r)) { - dev_err(dev, "clk_get for %s failed\n", clk_name); - return; - } - - l = clkdev_alloc(r, clk_alias, dev_name(dev)); - if (!l) { - dev_err(dev, "clkdev_alloc for %s failed\n", clk_alias); - return; - } - - clkdev_add(l); + 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, + clk_name, ret); } /** -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html