From: Nishanth Aravamudan <nacc@us.ibm.com>
To: kernel-janitors@vger.kernel.org
Subject: [KJ] [PATCH] sound/korg1212: remove sleep_on*() usage
Date: Wed, 26 Jan 2005 19:44:00 +0000 [thread overview]
Message-ID: <20050126194400.GF3593@us.ibm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1882 bytes --]
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 <nacc@us.ibm.com>
--- 2.6.11-rc2-kj-v/sound/pci/korg1212/korg1212.c 2005-01-24 09:34:24.000000000 -0800
+++ 2.6.11-rc2-kj/sound/pci/korg1212/korg1212.c 2005-01-26 10:50:44.000000000 -0800
@@ -620,11 +620,14 @@ static void snd_korg1212_SendStop(korg12
static 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_interrup
static 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;
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
reply other threads:[~2005-01-26 19:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050126194400.GF3593@us.ibm.com \
--to=nacc@us.ibm.com \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.