提交 9132f1b4 编写于 作者: R Russell King 提交者: Russell King

[ARM] omap: fix omap2_divisor_to_clksel() error return value

The error checks for omap2_divisor_to_clksel() and comment disagree with
the actual value returned on error.  Fix this to return the correct error
value.
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 d2f8d7ee
...@@ -565,7 +565,7 @@ u32 omap2_clksel_to_divisor(struct clk *clk, u32 field_val) ...@@ -565,7 +565,7 @@ u32 omap2_clksel_to_divisor(struct clk *clk, u32 field_val)
* *
* Given a struct clk of a rate-selectable clksel clock, and a clock divisor, * Given a struct clk of a rate-selectable clksel clock, and a clock divisor,
* find the corresponding register field value. The return register value is * find the corresponding register field value. The return register value is
* the value before left-shifting. Returns 0xffffffff on error * the value before left-shifting. Returns ~0 on error
*/ */
u32 omap2_divisor_to_clksel(struct clk *clk, u32 div) u32 omap2_divisor_to_clksel(struct clk *clk, u32 div)
{ {
...@@ -577,7 +577,7 @@ u32 omap2_divisor_to_clksel(struct clk *clk, u32 div) ...@@ -577,7 +577,7 @@ u32 omap2_divisor_to_clksel(struct clk *clk, u32 div)
clks = omap2_get_clksel_by_parent(clk, clk->parent); clks = omap2_get_clksel_by_parent(clk, clk->parent);
if (clks == NULL) if (clks == NULL)
return 0; return ~0;
for (clkr = clks->rates; clkr->div; clkr++) { for (clkr = clks->rates; clkr->div; clkr++) {
if ((clkr->flags & cpu_mask) && (clkr->div == div)) if ((clkr->flags & cpu_mask) && (clkr->div == div))
...@@ -588,7 +588,7 @@ u32 omap2_divisor_to_clksel(struct clk *clk, u32 div) ...@@ -588,7 +588,7 @@ u32 omap2_divisor_to_clksel(struct clk *clk, u32 div)
printk(KERN_ERR "clock: Could not find divisor %d for " printk(KERN_ERR "clock: Could not find divisor %d for "
"clock %s parent %s\n", div, clk->name, "clock %s parent %s\n", div, clk->name,
clk->parent->name); clk->parent->name);
return 0; return ~0;
} }
return clkr->val; return clkr->val;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册