Skip to content

Commit

Permalink
arm: tegra: fix error check in tegra2_clocks.c
Browse files Browse the repository at this point in the history
Checking 'rate < 0' doesn't work because 'rate' is unsigned.

Signed-off-by: Nicolas Kaiser <[email protected]>
Signed-off-by: Colin Cross <[email protected]>
  • Loading branch information
nikai3d authored and colincross committed Apr 1, 2011
1 parent c8309ef commit 906c3b6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions arch/arm/mach-tegra/tegra2_clocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 906c3b6

Please sign in to comment.