Use msleep() in a few places.
Showing the changes to kernel (1 of 2 files). Show all
Unified · Split
| @@ -9,6 +9,7 @@ · 8 unmodified lines | ||
| 9 | 9 | #include <linux/irq.h> |
| 10 | 10 | #include <linux/module.h> |
| 11 | 11 | #include <linux/interrupt.h> |
| 12 | +#include <linux/delay.h> | |
| 12 | 13 | |
| 13 | 14 | /* |
| 14 | 15 | * Autodetection depends on the fact that any interrupt that |
| @@ -26,7 +27,7 @@ static DECLARE_MUTEX(probe_sem); · 11 unmodified lines | ||
| 26 | 27 | */ |
| 27 | 28 | unsigned long probe_irq_on(void) |
| 28 | 29 | { |
| 29 | − unsigned long val, delay; | |
| 30 | + unsigned long val; | |
| 30 | 31 | irq_desc_t *desc; |
| 31 | 32 | unsigned int i; |
| 32 | 33 | |
| @@ -45,8 +46,7 @@ unsigned long probe_irq_on(void) · 12 unmodified lines | ||
| 45 | 46 | } |
| 46 | 47 | |
| 47 | 48 | /* Wait for longstanding interrupts to trigger. */ |
| 48 | − for (delay = jiffies + HZ/50; time_after(delay, jiffies); ) | |
| 49 | − /* about 20ms delay */ barrier(); | |
| 49 | + msleep(20); | |
| 50 | 50 | |
| 51 | 51 | /* |
| 52 | 52 | * enable any unassigned irqs |
| @@ -68,8 +68,7 @@ unsigned long probe_irq_on(void) · 15 unmodified lines | ||
| 68 | 68 | /* |
| 69 | 69 | * Wait for spurious interrupts to trigger |
| 70 | 70 | */ |
| 71 | − for (delay = jiffies + HZ/10; time_after(delay, jiffies); ) | |
| 72 | − /* about 100ms delay */ barrier(); | |
| 71 | + msleep(100); | |
| 73 | 72 | |
| 74 | 73 | /* |
| 75 | 74 | * Now filter out any obviously spurious interrupts |