sound/korg1212: remove sleep_on*() usage
Subsystems (2)
PATCH 1/1 sound/korg1212: remove sleep_on*() usage
Hi,
Please consider applying.
Description: Directly use wait-queues instead of the deprecated sleep_on_timeout(). Since the sleep in this function is unconditional, wait_event_timeout() does not appear to be appropriate. Patch is compile-tested.
Signed-off-by Nishanth Aravamudan <[email protected]>
sound/pci/korg1212/korg1212.c +11 -4
@@ -620,11 +620,14 @@ static void snd_korg1212_SendStop(korg12static void snd_korg1212_SendStopAndWait (korg1212_t *korg1212) { +DEFINE_WAIT (wait);unsigned long flags;spin_lock_irqsave (&korg1212->lock, flags);snd_korg1212_SendStop (korg1212);spin_unlock_irqrestore (&korg1212->lock, flags); -sleep_on_timeout (&korg1212->wait, (HZ *3 ) /2 ); +prepare_to_wait (&korg1212->wait, &wait,TASK_UNINTERRUPTIBLE ); +schedule_timeout ((HZ *3 ) /2 ); +finish_wait (&korg1212->wait, &wait); }/* timer callback for checking the ack of stop request */
@@ -1243,7 +1246,8 @@ static irqreturn_t snd_korg1212_interrupstatic int snd_korg1212_downloadDSPCode (korg1212_t *korg1212) { - +DEFINE_WAIT (wait); +unsigned long i;#if K1212_DEBUG_LEVEL >0 K1212_DEBUG_PRINTK ("K1212_DEBUG: DSP download is starting... [%s]\n" , stateName[korg1212->cardState]);#endif
@@ -1267,9 +1271,12 @@ static int snd_korg1212_downloadDSPCode(if (rc)K1212_DEBUG_PRINTK ("K1212_DEBUG: Start DSP Download RC = %d [%s]\n" , rc, stateName[korg1212->cardState]);#endif -if (!sleep_on_timeout (&korg1212->wait,HZ *CARD_BOOT_TIMEOUT )) +prepare_to_wait (&korg1212->wait, &wait,TASK_UNINTERRUPTIBLE ); + i =schedule_timeout (HZ *CARD_BOOT_TIMEOUT ); +finish_wait (&korg1212->wait, &wait); +if (i ==0 )return -EBUSY ;/* timeout */ - +snd_korg1212_OnDSPDownloadComplete (korg1212);return 0 ;
_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors