Commit 1ca90bd4 authored by Russell King's avatar Russell King

ARM: omap2: use clkdev_add_alias()

When creating aliases of existing clkdev clocks, use clkdev_add_alias()
isntead of open coding the lookup and clk_lookup creation.
Acked-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent b2e01129
...@@ -47,7 +47,7 @@ static void _add_clkdev(struct omap_device *od, const char *clk_alias, ...@@ -47,7 +47,7 @@ static void _add_clkdev(struct omap_device *od, const char *clk_alias,
const char *clk_name) const char *clk_name)
{ {
struct clk *r; struct clk *r;
struct clk_lookup *l; int rc;
if (!clk_alias || !clk_name) if (!clk_alias || !clk_name)
return; return;
...@@ -62,21 +62,15 @@ static void _add_clkdev(struct omap_device *od, const char *clk_alias, ...@@ -62,21 +62,15 @@ static void _add_clkdev(struct omap_device *od, const char *clk_alias,
return; return;
} }
r = clk_get(NULL, clk_name); rc = clk_add_alias(clk_alias, dev_name(&od->pdev->dev), clk_name, NULL);
if (IS_ERR(r)) { if (rc) {
dev_err(&od->pdev->dev, if (rc == -ENODEV || rc == -ENOMEM)
"clk_get for %s failed\n", clk_name); dev_err(&od->pdev->dev,
return; "clkdev_alloc for %s failed\n", clk_alias);
else
dev_err(&od->pdev->dev,
"clk_get for %s failed\n", clk_name);
} }
l = clkdev_alloc(r, clk_alias, dev_name(&od->pdev->dev));
if (!l) {
dev_err(&od->pdev->dev,
"clkdev_alloc for %s failed\n", clk_alias);
return;
}
clkdev_add(l);
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment