提交 906c3b61 编写于 作者: N Nicolas Kaiser 提交者: Colin Cross

arm: tegra: fix error check in tegra2_clocks.c

Checking 'rate < 0' doesn't work because 'rate' is unsigned.
Signed-off-by: NNicolas Kaiser <nikai@nikai.net>
Signed-off-by: NColin Cross <ccross@android.com>
上级 c8309ef6
......@@ -1362,14 +1362,15 @@ static int tegra_clk_shared_bus_set_rate(struct clk *c, unsigned long rate)
{
unsigned long flags;
int ret;
long new_rate = rate;
rate = clk_round_rate(c->parent, rate);
if (rate < 0)
return rate;
new_rate = clk_round_rate(c->parent, new_rate);
if (new_rate < 0)
return new_rate;
spin_lock_irqsave(&c->parent->spinlock, flags);
c->u.shared_bus_user.rate = rate;
c->u.shared_bus_user.rate = new_rate;
ret = tegra_clk_shared_bus_update(c->parent);
spin_unlock_irqrestore(&c->parent->spinlock, flags);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册