diff options
author | Stephen Boyd <sboyd@codeaurora.org> | 2015-02-02 23:09:43 +0100 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2015-03-12 20:18:49 +0100 |
commit | 08b9575660cd6d654c05314fc41d2209f2d8bdfb (patch) | |
tree | a988748bd661eae7462e202d20674e4be3014323 /drivers/clk/clk.c | |
parent | clk: fractional-divider: support for divider bypassing (diff) | |
download | linux-08b9575660cd6d654c05314fc41d2209f2d8bdfb.tar.xz linux-08b9575660cd6d654c05314fc41d2209f2d8bdfb.zip |
clk: Missing set_phase op is an error
If a clock's clk_ops doesn't have the set_phase op set we should
return an error from clk_set_phase(). This way clock consumers
know that when they tried to set a phase it didn't work, as
opposed to the current behavior where the return value is 0
meaning success.
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Michael Turquette <mturquette@linaro.org>
Diffstat (limited to 'drivers/clk/clk.c')
-rw-r--r-- | drivers/clk/clk.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index b0313cb4369c..0b3f39c03785 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -2123,10 +2123,10 @@ EXPORT_SYMBOL_GPL(clk_set_parent); */ int clk_set_phase(struct clk *clk, int degrees) { - int ret = 0; + int ret = -EINVAL; if (!clk) - goto out; + return 0; /* sanity check degrees */ degrees %= 360; @@ -2135,18 +2135,14 @@ int clk_set_phase(struct clk *clk, int degrees) clk_prepare_lock(); - if (!clk->core->ops->set_phase) - goto out_unlock; - - ret = clk->core->ops->set_phase(clk->core->hw, degrees); + if (clk->core->ops->set_phase) + ret = clk->core->ops->set_phase(clk->core->hw, degrees); if (!ret) clk->core->phase = degrees; -out_unlock: clk_prepare_unlock(); -out: return ret; } EXPORT_SYMBOL_GPL(clk_set_phase); |