aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2007-07-17 07:05:19 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-17 13:23:10 -0400
commit3e98cee717fb8e9f4ff15a70e357927c5f3c7793 (patch)
tree3d37904e1d297631b4030f8c708d87df2a54b7f6 /drivers/char
parent24c032f1dd393c995545ecefa8c1585ae9ef6b37 (diff)
Char: specialix, remove busy waiting
use msleep instead, because not in atomic Cc: Roger Wolff <R.E.Wolff@BitWizard.nl> 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')
-rw-r--r--drivers/char/specialix.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c
index baf7234b6e66..455855631aef 100644
--- a/drivers/char/specialix.c
+++ b/drivers/char/specialix.c
@@ -345,18 +345,6 @@ static inline void sx_release_io_range(struct specialix_board * bp)
345} 345}
346 346
347 347
348/* Must be called with enabled interrupts */
349/* Ugly. Very ugly. Don't use this for anything else than initialization
350 code */
351static inline void sx_long_delay(unsigned long delay)
352{
353 unsigned long i;
354
355 for (i = jiffies + delay; time_after(i, jiffies); ) ;
356}
357
358
359
360/* Set the IRQ using the RTS lines that run to the PAL on the board.... */ 348/* Set the IRQ using the RTS lines that run to the PAL on the board.... */
361static int sx_set_irq ( struct specialix_board *bp) 349static int sx_set_irq ( struct specialix_board *bp)
362{ 350{
@@ -397,7 +385,7 @@ static int sx_init_CD186x(struct specialix_board * bp)
397 spin_lock_irqsave(&bp->lock, flags); 385 spin_lock_irqsave(&bp->lock, flags);
398 sx_out_off(bp, CD186x_CCR, CCR_HARDRESET); /* Reset CD186x chip */ 386 sx_out_off(bp, CD186x_CCR, CCR_HARDRESET); /* Reset CD186x chip */
399 spin_unlock_irqrestore(&bp->lock, flags); 387 spin_unlock_irqrestore(&bp->lock, flags);
400 sx_long_delay(HZ/20); /* Delay 0.05 sec */ 388 msleep(50); /* Delay 0.05 sec */
401 spin_lock_irqsave(&bp->lock, flags); 389 spin_lock_irqsave(&bp->lock, flags);
402 sx_out_off(bp, CD186x_GIVR, SX_ID); /* Set ID for this chip */ 390 sx_out_off(bp, CD186x_GIVR, SX_ID); /* Set ID for this chip */
403 sx_out_off(bp, CD186x_GICR, 0); /* Clear all bits */ 391 sx_out_off(bp, CD186x_GICR, 0); /* Clear all bits */
@@ -533,7 +521,7 @@ static int sx_probe(struct specialix_board *bp)
533 sx_wait_CCR(bp); 521 sx_wait_CCR(bp);
534 sx_out(bp, CD186x_CCR, CCR_TXEN); /* Enable transmitter */ 522 sx_out(bp, CD186x_CCR, CCR_TXEN); /* Enable transmitter */
535 sx_out(bp, CD186x_IER, IER_TXRDY); /* Enable tx empty intr */ 523 sx_out(bp, CD186x_IER, IER_TXRDY); /* Enable tx empty intr */
536 sx_long_delay(HZ/20); 524 msleep(50);
537 irqs = probe_irq_off(irqs); 525 irqs = probe_irq_off(irqs);
538 526
539 dprintk (SX_DEBUG_INIT, "SRSR = %02x, ", sx_in(bp, CD186x_SRSR)); 527 dprintk (SX_DEBUG_INIT, "SRSR = %02x, ", sx_in(bp, CD186x_SRSR));