arm: tegra: fix error check in tegra2_clocks.c
Checking 'rate < 0' doesn't work because 'rate' is unsigned. Signed-off-by: Nicolas Kaiser <nikai@nikai.net> Signed-off-by: Colin Cross <ccross@android.com>
This commit is contained in:
parent
c8309ef6a4
commit
906c3b616d
1 changed files with 5 additions and 4 deletions
|
@ -1362,14 +1362,15 @@ static int tegra_clk_shared_bus_set_rate(struct clk *c, unsigned long rate)
|
||||||
{
|
{
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int ret;
|
int ret;
|
||||||
|
long new_rate = rate;
|
||||||
|
|
||||||
rate = clk_round_rate(c->parent, rate);
|
new_rate = clk_round_rate(c->parent, new_rate);
|
||||||
if (rate < 0)
|
if (new_rate < 0)
|
||||||
return rate;
|
return new_rate;
|
||||||
|
|
||||||
spin_lock_irqsave(&c->parent->spinlock, flags);
|
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);
|
ret = tegra_clk_shared_bus_update(c->parent);
|
||||||
|
|
||||||
spin_unlock_irqrestore(&c->parent->spinlock, flags);
|
spin_unlock_irqrestore(&c->parent->spinlock, flags);
|
||||||
|
|
Loading…
Add table
Reference in a new issue