Commit 3c8e77dd authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Stephen Boyd

clk: move checking .get_parent to __clk_core_init()

The .get_parent is mandatory for multi-parent clocks.  Move the check
to __clk_core_init(), like other callback checkings.
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: default avatarVladimir Zapolskiy <vz@mleia.com>
[sboyd@codeaurora.org: Squashed in error path handling, fix typos
in commit message]
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent c44fccb5
...@@ -1695,13 +1695,6 @@ static struct clk_core *__clk_init_parent(struct clk_core *core) ...@@ -1695,13 +1695,6 @@ static struct clk_core *__clk_init_parent(struct clk_core *core)
goto out; goto out;
} }
if (!core->ops->get_parent) {
WARN(!core->ops->get_parent,
"%s: multi-parent clocks must implement .get_parent\n",
__func__);
goto out;
}
/* /*
* Do our best to cache parent clocks in core->parents. This prevents * Do our best to cache parent clocks in core->parents. This prevents
* unnecessary and expensive lookups. We don't set core->parent here; * unnecessary and expensive lookups. We don't set core->parent here;
...@@ -2333,6 +2326,13 @@ static int __clk_core_init(struct clk_core *core) ...@@ -2333,6 +2326,13 @@ static int __clk_core_init(struct clk_core *core)
goto out; goto out;
} }
if (core->num_parents > 1 && !core->ops->get_parent) {
pr_err("%s: %s must implement .get_parent as it has multi parents\n",
__func__, core->name);
ret = -EINVAL;
goto out;
}
if (core->ops->set_rate_and_parent && if (core->ops->set_rate_and_parent &&
!(core->ops->set_parent && core->ops->set_rate)) { !(core->ops->set_parent && core->ops->set_rate)) {
pr_err("%s: %s must implement .set_parent & .set_rate\n", pr_err("%s: %s must implement .set_parent & .set_rate\n",
......
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