Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 296878
b: refs/heads/master
c: 829ecbc
h: refs/heads/master
v: v3
  • Loading branch information
Axel Lin authored and Samuel Ortiz committed Mar 16, 2012
1 parent f4534d8 commit 3c7ad5f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 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: 1b1247dd75aa5cf5fae54a3bec7280046e9c7957
refs/heads/master: 829ecbcb14edea378a1409203ef0d4a68bbf795a
10 changes: 1 addition & 9 deletions trunk/drivers/mfd/sm501.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,14 +387,6 @@ int sm501_unit_power(struct device *dev, unsigned int unit, unsigned int to)

EXPORT_SYMBOL_GPL(sm501_unit_power);


/* Perform a rounded division. */
static long sm501fb_round_div(long num, long denom)
{
/* n / d + 1 / 2 = (2n + d) / 2d */
return (2 * num + denom) / (2 * denom);
}

/* clock value structure. */
struct sm501_clock {
unsigned long mclk;
Expand Down Expand Up @@ -428,7 +420,7 @@ static int sm501_calc_clock(unsigned long freq,
/* try all 8 shift values.*/
for (shift = 0; shift < 8; shift++) {
/* Calculate difference to requested clock */
diff = sm501fb_round_div(mclk, divider << shift) - freq;
diff = DIV_ROUND_CLOSEST(mclk, divider << shift) - freq;
if (diff < 0)
diff = -diff;

Expand Down

0 comments on commit 3c7ad5f

Please sign in to comment.