[ARM] 5536/1: Move clk_add_alias() to arch/arm/common/clkdev.c
This can be used for other arm platforms too as discussed on the linux-arm-kernel list. Also check the return value with IS_ERR and return PTR_ERR as suggested by Russell King. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:

committed by
Russell King

parent
5926a295bb
commit
c068303920
@@ -135,6 +135,24 @@ struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id,
|
||||
}
|
||||
EXPORT_SYMBOL(clkdev_alloc);
|
||||
|
||||
int clk_add_alias(const char *alias, const char *alias_dev_name, char *id,
|
||||
struct device *dev)
|
||||
{
|
||||
struct clk *r = clk_get(dev, id);
|
||||
struct clk_lookup *l;
|
||||
|
||||
if (IS_ERR(r))
|
||||
return PTR_ERR(r);
|
||||
|
||||
l = clkdev_alloc(r, alias, alias_dev_name);
|
||||
clk_put(r);
|
||||
if (!l)
|
||||
return -ENODEV;
|
||||
clkdev_add(l);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(clk_add_alias);
|
||||
|
||||
/*
|
||||
* clkdev_drop - remove a clock dynamically allocated
|
||||
*/
|
||||
|
Reference in New Issue
Block a user