diff options
Diffstat (limited to 'drivers/net/apne.c')
-rw-r--r-- | drivers/net/apne.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/apne.c b/drivers/net/apne.c index a94216b87184..b9820b86cdcc 100644 --- a/drivers/net/apne.c +++ b/drivers/net/apne.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <linux/delay.h> | 36 | #include <linux/delay.h> |
37 | #include <linux/netdevice.h> | 37 | #include <linux/netdevice.h> |
38 | #include <linux/etherdevice.h> | 38 | #include <linux/etherdevice.h> |
39 | #include <linux/jiffies.h> | ||
39 | 40 | ||
40 | #include <asm/system.h> | 41 | #include <asm/system.h> |
41 | #include <asm/io.h> | 42 | #include <asm/io.h> |
@@ -216,7 +217,7 @@ static int __init apne_probe1(struct net_device *dev, int ioaddr) | |||
216 | outb(inb(ioaddr + NE_RESET), ioaddr + NE_RESET); | 217 | outb(inb(ioaddr + NE_RESET), ioaddr + NE_RESET); |
217 | 218 | ||
218 | while ((inb(ioaddr + NE_EN0_ISR) & ENISR_RESET) == 0) | 219 | while ((inb(ioaddr + NE_EN0_ISR) & ENISR_RESET) == 0) |
219 | if (jiffies - reset_start_time > 2*HZ/100) { | 220 | if (time_after(jiffies, reset_start_time + 2*HZ/100)) { |
220 | printk(" not found (no reset ack).\n"); | 221 | printk(" not found (no reset ack).\n"); |
221 | return -ENODEV; | 222 | return -ENODEV; |
222 | } | 223 | } |
@@ -382,7 +383,7 @@ apne_reset_8390(struct net_device *dev) | |||
382 | 383 | ||
383 | /* This check _should_not_ be necessary, omit eventually. */ | 384 | /* This check _should_not_ be necessary, omit eventually. */ |
384 | while ((inb(NE_BASE+NE_EN0_ISR) & ENISR_RESET) == 0) | 385 | while ((inb(NE_BASE+NE_EN0_ISR) & ENISR_RESET) == 0) |
385 | if (jiffies - reset_start_time > 2*HZ/100) { | 386 | if (time_after(jiffies, reset_start_time + 2*HZ/100)) { |
386 | printk("%s: ne_reset_8390() did not complete.\n", dev->name); | 387 | printk("%s: ne_reset_8390() did not complete.\n", dev->name); |
387 | break; | 388 | break; |
388 | } | 389 | } |
@@ -530,7 +531,7 @@ apne_block_output(struct net_device *dev, int count, | |||
530 | dma_start = jiffies; | 531 | dma_start = jiffies; |
531 | 532 | ||
532 | while ((inb(NE_BASE + NE_EN0_ISR) & ENISR_RDC) == 0) | 533 | while ((inb(NE_BASE + NE_EN0_ISR) & ENISR_RDC) == 0) |
533 | if (jiffies - dma_start > 2*HZ/100) { /* 20ms */ | 534 | if (time_after(jiffies, dma_start + 2*HZ/100)) { /* 20ms */ |
534 | printk("%s: timeout waiting for Tx RDC.\n", dev->name); | 535 | printk("%s: timeout waiting for Tx RDC.\n", dev->name); |
535 | apne_reset_8390(dev); | 536 | apne_reset_8390(dev); |
536 | NS8390_init(dev,1); | 537 | NS8390_init(dev,1); |