X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Foss%2Frme96xx.c;h=faa0b7919b6525c757c16c88b7c8e7dcc0bd5922;hb=987b0145d94eecf292d8b301228356f44611ab7c;hp=a1ec9d131ab38f1ad8f356f096b24204fb3dbbca;hpb=f7ed79d23a47594e7834d66a8f14449796d4f3e6;p=linux-2.6.git diff --git a/sound/oss/rme96xx.c b/sound/oss/rme96xx.c index a1ec9d131..faa0b7919 100644 --- a/sound/oss/rme96xx.c +++ b/sound/oss/rme96xx.c @@ -58,7 +58,6 @@ TODO: #include #include #include -#include #include #include @@ -327,7 +326,7 @@ typedef struct _rme96xx_info { /* waiting and locking */ wait_queue_head_t wait; - struct mutex open_mutex; + struct semaphore open_sem; wait_queue_head_t open_wait; } dma[RME96xx_MAX_DEVS]; @@ -843,7 +842,7 @@ static void busmaster_free(void* ptr,int size) { static int rme96xx_dmabuf_init(rme96xx_info * s,struct dmabuf* dma,int ioffset,int ooffset) { - mutex_init(&dma->open_mutex); + init_MUTEX(&dma->open_sem); init_waitqueue_head(&dma->open_wait); init_waitqueue_head(&dma->wait); dma->s = s; @@ -1470,21 +1469,21 @@ static int rme96xx_open(struct inode *in, struct file *f) dma = &s->dma[devnum]; f->private_data = dma; /* wait for device to become free */ - mutex_lock(&dma->open_mutex); + down(&dma->open_sem); while (dma->open_mode & f->f_mode) { if (f->f_flags & O_NONBLOCK) { - mutex_unlock(&dma->open_mutex); + up(&dma->open_sem); return -EBUSY; } add_wait_queue(&dma->open_wait, &wait); __set_current_state(TASK_INTERRUPTIBLE); - mutex_unlock(&dma->open_mutex); + up(&dma->open_sem); schedule(); remove_wait_queue(&dma->open_wait, &wait); set_current_state(TASK_RUNNING); if (signal_pending(current)) return -ERESTARTSYS; - mutex_lock(&dma->open_mutex); + down(&dma->open_sem); } COMM ("hardware open") @@ -1493,7 +1492,7 @@ static int rme96xx_open(struct inode *in, struct file *f) dma->open_mode |= (f->f_mode & (FMODE_READ | FMODE_WRITE)); dma->opened = 1; - mutex_unlock(&dma->open_mutex); + up(&dma->open_sem); DBG(printk("device num %d open finished\n",devnum)); return 0; @@ -1525,7 +1524,7 @@ static int rme96xx_release(struct inode *in, struct file *file) } wake_up(&dma->open_wait); - mutex_unlock(&dma->open_mutex); + up(&dma->open_sem); return 0; }