aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/sscape.c
diff options
context:
space:
mode:
authorNishanth Aravamudan <nacc@us.ibm.com>2005-10-24 09:02:37 -0400
committerJaroslav Kysela <perex@suse.cz>2005-11-04 07:19:49 -0500
commit8433a509c0eb6bb1f33ce39c82c580b8901619ee (patch)
treef1554905dee5da4e840dfd674d5b004124496a22 /sound/isa/sscape.c
parentd78bec210f07b06f406b877b9179e0cc281ae8e6 (diff)
[ALSA] Fix schedule_timeout usage
Use schedule_timeout_{,un}interruptible() instead of set_current_state()/schedule_timeout() to reduce kernel size. Also use human-time conversion functions instead of hard-coded division to avoid rounding issues. Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/isa/sscape.c')
-rw-r--r--sound/isa/sscape.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/sound/isa/sscape.c b/sound/isa/sscape.c
index 1036876146c4..11588067fa4f 100644
--- a/sound/isa/sscape.c
+++ b/sound/isa/sscape.c
@@ -343,19 +343,6 @@ static void soundscape_free(snd_card_t * c)
343} 343}
344 344
345/* 345/*
346 * Put this process into an idle wait-state for a certain number
347 * of "jiffies". The process can almost certainly be rescheduled
348 * while we're waiting, and so we must NOT be holding any spinlocks
349 * when we call this function. If we are then we risk DEADLOCK in
350 * SMP (Ha!) or pre-emptible kernels.
351 */
352static inline void sleep(long jiffs, int state)
353{
354 set_current_state(state);
355 schedule_timeout(jiffs);
356}
357
358/*
359 * Tell the SoundScape to begin a DMA tranfer using the given channel. 346 * Tell the SoundScape to begin a DMA tranfer using the given channel.
360 * All locking issues are left to the caller. 347 * All locking issues are left to the caller.
361 */ 348 */
@@ -392,7 +379,7 @@ static int obp_startup_ack(struct soundscape *s, unsigned timeout)
392 unsigned long flags; 379 unsigned long flags;
393 unsigned char x; 380 unsigned char x;
394 381
395 sleep(1, TASK_INTERRUPTIBLE); 382 schedule_timeout_interruptible(1);
396 383
397 spin_lock_irqsave(&s->lock, flags); 384 spin_lock_irqsave(&s->lock, flags);
398 x = inb(HOST_DATA_IO(s->io_base)); 385 x = inb(HOST_DATA_IO(s->io_base));
@@ -419,7 +406,7 @@ static int host_startup_ack(struct soundscape *s, unsigned timeout)
419 unsigned long flags; 406 unsigned long flags;
420 unsigned char x; 407 unsigned char x;
421 408
422 sleep(1, TASK_INTERRUPTIBLE); 409 schedule_timeout_interruptible(1);
423 410
424 spin_lock_irqsave(&s->lock, flags); 411 spin_lock_irqsave(&s->lock, flags);
425 x = inb(HOST_DATA_IO(s->io_base)); 412 x = inb(HOST_DATA_IO(s->io_base));