diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2007-07-16 02:40:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-16 12:05:44 -0400 |
commit | 7126dd0562c78fa393a53120155e9b265cc68f9d (patch) | |
tree | 3db874d51f57f0f79a881104e5c69d0bf50a9d4c /drivers/char/ip2/i2ellis.c | |
parent | 6defec139a0fb0fb36c41a441f8417360da81ea1 (diff) |
Char: ip2, use msleep for sleeping
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/ip2/i2ellis.c')
-rw-r--r-- | drivers/char/ip2/i2ellis.c | 44 |
1 files changed, 1 insertions, 43 deletions
diff --git a/drivers/char/ip2/i2ellis.c b/drivers/char/ip2/i2ellis.c index dd761a1e4f08..61ef013b8445 100644 --- a/drivers/char/ip2/i2ellis.c +++ b/drivers/char/ip2/i2ellis.c | |||
@@ -43,8 +43,6 @@ static void iiEnableMailIrqIIEX(i2eBordStrPtr); | |||
43 | static void iiWriteMaskII(i2eBordStrPtr, unsigned char); | 43 | static void iiWriteMaskII(i2eBordStrPtr, unsigned char); |
44 | static void iiWriteMaskIIEX(i2eBordStrPtr, unsigned char); | 44 | static void iiWriteMaskIIEX(i2eBordStrPtr, unsigned char); |
45 | 45 | ||
46 | static void ii2DelayTimer(unsigned int); | ||
47 | static void ii2DelayWakeup(unsigned long id); | ||
48 | static void ii2Nop(void); | 46 | static void ii2Nop(void); |
49 | 47 | ||
50 | //*************** | 48 | //*************** |
@@ -55,8 +53,6 @@ static int ii2Safe; // Safe I/O address for delay routine | |||
55 | 53 | ||
56 | static int iiDelayed; // Set when the iiResetDelay function is | 54 | static int iiDelayed; // Set when the iiResetDelay function is |
57 | // called. Cleared when ANY board is reset. | 55 | // called. Cleared when ANY board is reset. |
58 | static struct timer_list * pDelayTimer; // Used by iiDelayTimer | ||
59 | static wait_queue_head_t pDelayWait; // Used by iiDelayTimer | ||
60 | static rwlock_t Dl_spinlock; | 56 | static rwlock_t Dl_spinlock; |
61 | 57 | ||
62 | //******** | 58 | //******** |
@@ -86,9 +82,6 @@ static rwlock_t Dl_spinlock; | |||
86 | static void | 82 | static void |
87 | iiEllisInit(void) | 83 | iiEllisInit(void) |
88 | { | 84 | { |
89 | pDelayTimer = kmalloc ( sizeof (struct timer_list), GFP_KERNEL ); | ||
90 | init_timer(pDelayTimer); | ||
91 | init_waitqueue_head(&pDelayWait); | ||
92 | LOCK_INIT(&Dl_spinlock); | 85 | LOCK_INIT(&Dl_spinlock); |
93 | } | 86 | } |
94 | 87 | ||
@@ -106,7 +99,6 @@ iiEllisInit(void) | |||
106 | static void | 99 | static void |
107 | iiEllisCleanup(void) | 100 | iiEllisCleanup(void) |
108 | { | 101 | { |
109 | kfree(pDelayTimer); | ||
110 | } | 102 | } |
111 | 103 | ||
112 | //****************************************************************************** | 104 | //****************************************************************************** |
@@ -560,19 +552,6 @@ iiInitialize(i2eBordStrPtr pB) | |||
560 | COMPLETE(pB, I2EE_GOOD); | 552 | COMPLETE(pB, I2EE_GOOD); |
561 | } | 553 | } |
562 | 554 | ||
563 | //======================================================= | ||
564 | // Delay Routines | ||
565 | // | ||
566 | // iiDelayIO | ||
567 | // iiNop | ||
568 | //======================================================= | ||
569 | |||
570 | static void | ||
571 | ii2DelayWakeup(unsigned long id) | ||
572 | { | ||
573 | wake_up_interruptible ( &pDelayWait ); | ||
574 | } | ||
575 | |||
576 | //****************************************************************************** | 555 | //****************************************************************************** |
577 | // Function: ii2DelayTimer(mseconds) | 556 | // Function: ii2DelayTimer(mseconds) |
578 | // Parameters: mseconds - number of milliseconds to delay | 557 | // Parameters: mseconds - number of milliseconds to delay |
@@ -594,28 +573,7 @@ ii2DelayWakeup(unsigned long id) | |||
594 | static void | 573 | static void |
595 | ii2DelayTimer(unsigned int mseconds) | 574 | ii2DelayTimer(unsigned int mseconds) |
596 | { | 575 | { |
597 | wait_queue_t wait; | 576 | msleep_interruptible(mseconds); |
598 | |||
599 | init_waitqueue_entry(&wait, current); | ||
600 | |||
601 | init_timer ( pDelayTimer ); | ||
602 | |||
603 | add_wait_queue(&pDelayWait, &wait); | ||
604 | |||
605 | set_current_state( TASK_INTERRUPTIBLE ); | ||
606 | |||
607 | pDelayTimer->expires = jiffies + ( mseconds + 9 ) / 10; | ||
608 | pDelayTimer->function = ii2DelayWakeup; | ||
609 | pDelayTimer->data = 0; | ||
610 | |||
611 | add_timer ( pDelayTimer ); | ||
612 | |||
613 | schedule(); | ||
614 | |||
615 | set_current_state( TASK_RUNNING ); | ||
616 | remove_wait_queue(&pDelayWait, &wait); | ||
617 | |||
618 | del_timer ( pDelayTimer ); | ||
619 | } | 577 | } |
620 | 578 | ||
621 | #if 0 | 579 | #if 0 |