Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 187387
b: refs/heads/master
c: f9e011b
h: refs/heads/master
i:
  187385: 73b558b
  187383: 58b3785
v: v3
  • Loading branch information
Ben Dooks committed Jan 18, 2010
1 parent 4c6bdd9 commit 1ce690c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f3b464cca94c4a8f54fbc11ec5af8b143fd1750b
refs/heads/master: f9e011b6b305d38445bbd4a1e7a8814e056de37b
8 changes: 5 additions & 3 deletions trunk/arch/arm/plat-samsung/clock-clksrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static int s3c_setrate_clksrc(struct clk *clk, unsigned long rate)

rate = clk_round_rate(clk, rate);
div = clk_get_rate(clk->parent) / rate;
if (div > 16)
if (div > (1 << sclk->reg_div.size))
return -EINVAL;

val = __raw_readl(reg);
Expand Down Expand Up @@ -102,7 +102,9 @@ static int s3c_setparent_clksrc(struct clk *clk, struct clk *parent)
static unsigned long s3c_roundrate_clksrc(struct clk *clk,
unsigned long rate)
{
struct clksrc_clk *sclk = to_clksrc(clk);
unsigned long parent_rate = clk_get_rate(clk->parent);
int max_div = 1 << sclk->reg_div.size;
int div;

if (rate >= parent_rate)
Expand All @@ -114,8 +116,8 @@ static unsigned long s3c_roundrate_clksrc(struct clk *clk,

if (div == 0)
div = 1;
if (div > 16)
div = 16;
if (div > max_div)
div = max_div;

rate = parent_rate / div;
}
Expand Down

0 comments on commit 1ce690c

Please sign in to comment.