]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - sound/pci/mixart/mixart.c
[ALSA] sound/pci: fix-up sleeping paths
[linux-2.6.git] / sound / pci / mixart / mixart.c
index 082c0d0f73d2ff6afea55c342d9517483efbeed3..6c868d913634cce920e35a364c930e71939cfae7 100644 (file)
@@ -445,9 +445,9 @@ static int snd_mixart_trigger(snd_pcm_substream_t *subs, int cmd)
 
 static int mixart_sync_nonblock_events(mixart_mgr_t *mgr)
 {
-       int timeout = HZ;
+       unsigned long timeout = jiffies + HZ;
        while (atomic_read(&mgr->msg_processed) > 0) {
-               if (! timeout--) {
+               if (time_after(jiffies, timeout)) {
                        snd_printk(KERN_ERR "mixart: cannot process nonblock events!\n");
                        return -EBUSY;
                }