Commit 8f372a59 authored by Dave Jones's avatar Dave Jones Committed by Linus Torvalds

[PATCH] jiffy wrap fixes

parent a23a3454
...@@ -72,12 +72,12 @@ inline void lmc_trace(struct net_device *dev, char *msg){ ...@@ -72,12 +72,12 @@ inline void lmc_trace(struct net_device *dev, char *msg){
if(in_interrupt()){ if(in_interrupt()){
printk("%s: * %s\n", dev->name, msg); printk("%s: * %s\n", dev->name, msg);
// while(jiffies < j+10) // while(time_before(jiffies, j+10))
// ; // ;
} }
else { else {
printk("%s: %s\n", dev->name, msg); printk("%s: %s\n", dev->name, msg);
while(jiffies < j) while(time_before(jiffies, j))
schedule(); schedule();
} }
#endif #endif
......
...@@ -535,7 +535,7 @@ static int li_ad1843_wait(lithium_t *lith) ...@@ -535,7 +535,7 @@ static int li_ad1843_wait(lithium_t *lith)
{ {
unsigned long later = jiffies + 2; unsigned long later = jiffies + 2;
while (li_readl(lith, LI_CODEC_COMMAND) & LI_CC_BUSY) while (li_readl(lith, LI_CODEC_COMMAND) & LI_CC_BUSY)
if (jiffies >= later) if (time_after_eq(jiffies, later))
return -EBUSY; return -EBUSY;
return 0; return 0;
} }
...@@ -1358,7 +1358,7 @@ static int __init ad1843_init(lithium_t *lith) ...@@ -1358,7 +1358,7 @@ static int __init ad1843_init(lithium_t *lith)
later = jiffies + HZ / 2; /* roughly half a second */ later = jiffies + HZ / 2; /* roughly half a second */
DBGDO(shut_up++); DBGDO(shut_up++);
while (ad1843_read_bits(lith, &ad1843_PDNO)) { while (ad1843_read_bits(lith, &ad1843_PDNO)) {
if (jiffies > later) { if (time_after(jiffies, later)) {
printk(KERN_ERR printk(KERN_ERR
"vwsnd audio: AD1843 won't power up\n"); "vwsnd audio: AD1843 won't power up\n");
return -EIO; return -EIO;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment