@@ -188,26 +188,32 @@ static int _dpll_test_fint(struct clk *clk, u8 n)
}
/**
- * omap2_init_clk_clkdm - look up a clockdomain name, store pointer in clk
+ * _omap2_init_clk_clkdm - look up a clockdomain name, store pointer in clk
* @clk: OMAP clock struct ptr to use
*
* Convert a clockdomain name stored in a struct clk 'clk' into a
* clockdomain pointer, and save it into the struct clk. Intended to be
- * called during clk_register(). No return value.
+ * called during clk_register(). Returns 0 on success or -ENOENT if the
+ * clockdomain is not found.
*/
-void omap2_init_clk_clkdm(struct clk *clk)
+static int _omap2_init_clk_clkdm(struct clk *clk)
{
struct clockdomain *clkdm;
+ int ret;
clkdm = clkdm_lookup(clk->clkdm.name);
if (clkdm) {
pr_debug("clock: associated clk %s to clkdm %s\n",
clk->name, clk->clkdm.name);
clk->clkdm.ptr = clkdm;
+ ret = 0;
} else {
pr_err("clock: %s: could not associate to clkdm %s\n",
clk->name, clk->clkdm.name);
+ ret = -ENOENT;
}
+
+ return ret;
}
/**
@@ -1082,12 +1088,5 @@ void omap2_clk_disable_unused(struct clk *clk)
int omap2_clk_register(struct clk *clk)
{
- if (!clk->clkdm.name) {
- pr_debug("clock: %s: missing clockdomain", clk->name);
- WARN_ON(1);
- return -EINVAL;
- }
-
- omap2_init_clk_clkdm(clk);
- return 0;
+ return _omap2_init_clk_clkdm(clk);
}