diff options
author | Georgi Djakov <georgi.djakov@linaro.org> | 2015-03-20 17:30:24 +0100 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2015-03-23 23:50:53 +0100 |
commit | 7f218978f10693f65e35b0bbcdcd539fbe78221a (patch) | |
tree | 7f83ff1dfa6340053dc005784ff9930d4e101807 /drivers/clk/qcom/clk-rcg2.c | |
parent | clk: qcom: fix RCG M/N counter configuration (diff) | |
download | linux-7f218978f10693f65e35b0bbcdcd539fbe78221a.tar.xz linux-7f218978f10693f65e35b0bbcdcd539fbe78221a.zip |
clk: qcom: Fix clk_get_parent function return value
According to the common clock framework API, the clk_get_parent() function
should return u8. Currently we are returning negative values on error. Fix
this and use the default parent in case of an error.
Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/clk/qcom/clk-rcg2.c')
-rw-r--r-- | drivers/clk/qcom/clk-rcg2.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/clk/qcom/clk-rcg2.c b/drivers/clk/qcom/clk-rcg2.c index 381f27469a9c..10c2e45832b8 100644 --- a/drivers/clk/qcom/clk-rcg2.c +++ b/drivers/clk/qcom/clk-rcg2.c @@ -69,7 +69,7 @@ static u8 clk_rcg2_get_parent(struct clk_hw *hw) ret = regmap_read(rcg->clkr.regmap, rcg->cmd_rcgr + CFG_REG, &cfg); if (ret) - return ret; + goto err; cfg &= CFG_SRC_SEL_MASK; cfg >>= CFG_SRC_SEL_SHIFT; @@ -78,7 +78,10 @@ static u8 clk_rcg2_get_parent(struct clk_hw *hw) if (cfg == rcg->parent_map[i]) return i; - return -EINVAL; +err: + pr_debug("%s: Clock %s has invalid parent, using default.\n", + __func__, __clk_get_name(hw->clk)); + return 0; } static int update_config(struct clk_rcg2 *rcg) |