Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 295508
b: refs/heads/master
c: 2efee38
h: refs/heads/master
v: v3
  • Loading branch information
Roland Stigge authored and Olof Johansson committed Feb 10, 2012
1 parent 590837d commit a76bd62
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 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: 66f32a0b356e2e4a1dc98766d50316e3315e3405
refs/heads/master: 2efee387dc7c3a6cca92f6e9250a464ae3f8aec8
12 changes: 6 additions & 6 deletions trunk/arch/arm/mach-lpc32xx/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ static struct clk osc_32KHz = {
static int local_pll397_enable(struct clk *clk, int enable)
{
u32 reg;
unsigned long timeout = 1 + msecs_to_jiffies(10);
unsigned long timeout = jiffies + msecs_to_jiffies(10);

reg = __raw_readl(LPC32XX_CLKPWR_PLL397_CTRL);

Expand All @@ -144,7 +144,7 @@ static int local_pll397_enable(struct clk *clk, int enable)
/* Wait for PLL397 lock */
while (((__raw_readl(LPC32XX_CLKPWR_PLL397_CTRL) &
LPC32XX_CLKPWR_SYSCTRL_PLL397_STS) == 0) &&
(timeout > jiffies))
time_before(jiffies, timeout))
cpu_relax();

if ((__raw_readl(LPC32XX_CLKPWR_PLL397_CTRL) &
Expand All @@ -158,7 +158,7 @@ static int local_pll397_enable(struct clk *clk, int enable)
static int local_oscmain_enable(struct clk *clk, int enable)
{
u32 reg;
unsigned long timeout = 1 + msecs_to_jiffies(10);
unsigned long timeout = jiffies + msecs_to_jiffies(10);

reg = __raw_readl(LPC32XX_CLKPWR_MAIN_OSC_CTRL);

Expand All @@ -173,7 +173,7 @@ static int local_oscmain_enable(struct clk *clk, int enable)
/* Wait for main oscillator to start */
while (((__raw_readl(LPC32XX_CLKPWR_MAIN_OSC_CTRL) &
LPC32XX_CLKPWR_MOSC_DISABLE) != 0) &&
(timeout > jiffies))
time_before(jiffies, timeout))
cpu_relax();

if ((__raw_readl(LPC32XX_CLKPWR_MAIN_OSC_CTRL) &
Expand Down Expand Up @@ -385,7 +385,7 @@ static int local_usbpll_enable(struct clk *clk, int enable)
{
u32 reg;
int ret = -ENODEV;
unsigned long timeout = 1 + msecs_to_jiffies(10);
unsigned long timeout = jiffies + msecs_to_jiffies(10);

reg = __raw_readl(LPC32XX_CLKPWR_USB_CTRL);

Expand All @@ -398,7 +398,7 @@ static int local_usbpll_enable(struct clk *clk, int enable)
__raw_writel(reg, LPC32XX_CLKPWR_USB_CTRL);

/* Wait for PLL lock */
while ((timeout > jiffies) & (ret == -ENODEV)) {
while (time_before(jiffies, timeout) && (ret == -ENODEV)) {
reg = __raw_readl(LPC32XX_CLKPWR_USB_CTRL);
if (reg & LPC32XX_CLKPWR_USBCTRL_PLL_STS)
ret = 0;
Expand Down

0 comments on commit a76bd62

Please sign in to comment.