From 8433a509c0eb6bb1f33ce39c82c580b8901619ee Mon Sep 17 00:00:00 2001 From: Nishanth Aravamudan Date: Mon, 24 Oct 2005 15:02:37 +0200 Subject: [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 Signed-off-by: Andrew Morton Signed-off-by: Takashi Iwai --- sound/isa/sscape.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'sound/isa/sscape.c') 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 @@ -342,19 +342,6 @@ static void soundscape_free(snd_card_t * c) free_dma(sscape->chip->dma1); } -/* - * Put this process into an idle wait-state for a certain number - * of "jiffies". The process can almost certainly be rescheduled - * while we're waiting, and so we must NOT be holding any spinlocks - * when we call this function. If we are then we risk DEADLOCK in - * SMP (Ha!) or pre-emptible kernels. - */ -static inline void sleep(long jiffs, int state) -{ - set_current_state(state); - schedule_timeout(jiffs); -} - /* * Tell the SoundScape to begin a DMA tranfer using the given channel. * All locking issues are left to the caller. @@ -392,7 +379,7 @@ static int obp_startup_ack(struct soundscape *s, unsigned timeout) unsigned long flags; unsigned char x; - sleep(1, TASK_INTERRUPTIBLE); + schedule_timeout_interruptible(1); spin_lock_irqsave(&s->lock, flags); x = inb(HOST_DATA_IO(s->io_base)); @@ -419,7 +406,7 @@ static int host_startup_ack(struct soundscape *s, unsigned timeout) unsigned long flags; unsigned char x; - sleep(1, TASK_INTERRUPTIBLE); + schedule_timeout_interruptible(1); spin_lock_irqsave(&s->lock, flags); x = inb(HOST_DATA_IO(s->io_base)); -- cgit v1.2.3