summaryrefslogtreecommitdiffstats
path: root/drivers/clk/clk.c
diff options
context:
space:
mode:
authorMasahiro Yamada2015-12-28 11:23:04 +0100
committerStephen Boyd2016-02-02 20:52:06 +0100
commit3c8e77dd20ab733f855e66bb6197ce84eb33e480 (patch)
tree0a9db5b0245c1230ec680cd1def0fbeb32676c48 /drivers/clk/clk.c
parentclk: replace pr_warn() with pr_err() for fatal cases (diff)
downloadkernel-qcow2-linux-3c8e77dd20ab733f855e66bb6197ce84eb33e480.tar.gz
kernel-qcow2-linux-3c8e77dd20ab733f855e66bb6197ce84eb33e480.tar.xz
kernel-qcow2-linux-3c8e77dd20ab733f855e66bb6197ce84eb33e480.zip
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: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Vladimir Zapolskiy <vz@mleia.com> [sboyd@codeaurora.org: Squashed in error path handling, fix typos in commit message] Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/clk/clk.c')
-rw-r--r--drivers/clk/clk.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 09d84453ea3a..7fe94a5c6b4a 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1695,13 +1695,6 @@ static struct clk_core *__clk_init_parent(struct clk_core *core)
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
* unnecessary and expensive lookups. We don't set core->parent here;
@@ -2333,6 +2326,13 @@ static int __clk_core_init(struct clk_core *core)
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 &&
!(core->ops->set_parent && core->ops->set_rate)) {
pr_err("%s: %s must implement .set_parent & .set_rate\n",