aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/riscom8.c
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2007-07-17 07:05:20 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-17 13:23:10 -0400
commitc4ebd9277705904aea25937c9a2d347c88c063c8 (patch)
treeffcdb5d9596486a89edb5cd3607873ccbcae4aea /drivers/char/riscom8.c
parent3e98cee717fb8e9f4ff15a70e357927c5f3c7793 (diff)
Char: riscom8, eliminate busy loop
riscom8, eliminate busy loop 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/riscom8.c')
-rw-r--r--drivers/char/riscom8.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c
index 3494e3fc44bf..b37e626f4faa 100644
--- a/drivers/char/riscom8.c
+++ b/drivers/char/riscom8.c
@@ -213,14 +213,6 @@ static inline void rc_release_io_range(struct riscom_board * const bp)
213 release_region(RC_TO_ISA(rc_ioport[i]) + bp->base, 1); 213 release_region(RC_TO_ISA(rc_ioport[i]) + bp->base, 1);
214} 214}
215 215
216/* Must be called with enabled interrupts */
217static inline void rc_long_delay(unsigned long delay)
218{
219 unsigned long i;
220
221 for (i = jiffies + delay; time_after(i,jiffies); ) ;
222}
223
224/* Reset and setup CD180 chip */ 216/* Reset and setup CD180 chip */
225static void __init rc_init_CD180(struct riscom_board const * bp) 217static void __init rc_init_CD180(struct riscom_board const * bp)
226{ 218{
@@ -231,7 +223,7 @@ static void __init rc_init_CD180(struct riscom_board const * bp)
231 rc_wait_CCR(bp); /* Wait for CCR ready */ 223 rc_wait_CCR(bp); /* Wait for CCR ready */
232 rc_out(bp, CD180_CCR, CCR_HARDRESET); /* Reset CD180 chip */ 224 rc_out(bp, CD180_CCR, CCR_HARDRESET); /* Reset CD180 chip */
233 sti(); 225 sti();
234 rc_long_delay(HZ/20); /* Delay 0.05 sec */ 226 msleep(50); /* Delay 0.05 sec */
235 cli(); 227 cli();
236 rc_out(bp, CD180_GIVR, RC_ID); /* Set ID for this chip */ 228 rc_out(bp, CD180_GIVR, RC_ID); /* Set ID for this chip */
237 rc_out(bp, CD180_GICR, 0); /* Clear all bits */ 229 rc_out(bp, CD180_GICR, 0); /* Clear all bits */
@@ -280,7 +272,7 @@ static int __init rc_probe(struct riscom_board *bp)
280 rc_wait_CCR(bp); 272 rc_wait_CCR(bp);
281 rc_out(bp, CD180_CCR, CCR_TXEN); /* Enable transmitter */ 273 rc_out(bp, CD180_CCR, CCR_TXEN); /* Enable transmitter */
282 rc_out(bp, CD180_IER, IER_TXRDY); /* Enable tx empty intr */ 274 rc_out(bp, CD180_IER, IER_TXRDY); /* Enable tx empty intr */
283 rc_long_delay(HZ/20); 275 msleep(50);
284 irqs = probe_irq_off(irqs); 276 irqs = probe_irq_off(irqs);
285 val1 = rc_in(bp, RC_BSR); /* Get Board Status reg */ 277 val1 = rc_in(bp, RC_BSR); /* Get Board Status reg */
286 val2 = rc_in(bp, RC_ACK_TINT); /* ACK interrupt */ 278 val2 = rc_in(bp, RC_ACK_TINT); /* ACK interrupt */