]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ARM: OMAP: OSS: sem2mutex conversion
authorKomal Shah <komal_shah802003@yahoo.com>
Tue, 28 Mar 2006 15:00:26 +0000 (07:00 -0800)
committerTony Lindgren <tony@atomide.com>
Tue, 28 Mar 2006 15:00:26 +0000 (07:00 -0800)
sem2mutex conversion

Signed-off-by: Komal Shah <komal_shah802003@yahoo.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
sound/oss/omap-audio-tsc2101.c
sound/oss/omap-audio.c
sound/oss/omap-audio.h

index 13dc7aff1ab7d5c2d7f5f09349747f94194dcbd9..f8e6dacf1ff79609cac92972ecc4aa28f0abe50d 100644 (file)
@@ -33,8 +33,8 @@
 #include <linux/errno.h>
 #include <linux/sound.h>
 #include <linux/soundcard.h>
+#include <linux/mutex.h>
 
-#include <asm/semaphore.h>
 #include <asm/uaccess.h>
 #include <asm/hardware.h>
 #include <asm/arch/dma.h>
@@ -326,7 +326,7 @@ static audio_state_t tsc2101_state = {
        .hw_remove      = omap_tsc2101_remove,
        .hw_suspend     = omap_tsc2101_suspend,
        .hw_resume      = omap_tsc2101_resume,
-       .sem            = __SEMAPHORE_INIT(tsc2101_state.sem, 1),
+       .mutex          = __MUTEX_INITIALIZER(tsc2101_state.mutex),
 };
 
 /* This will be defined in the Audio.h */
index 38857007e70f7c56a11d94efe79de2efcd14c191..cc1f14a2d29bc5fa12100e154cb980d8102fafaa 100644 (file)
 #include <linux/delay.h>
 #include <linux/platform_device.h>
 #include <linux/completion.h>
+#include <linux/mutex.h>
 
 #include <asm/uaccess.h>
 #include <asm/io.h>
 #include <asm/hardware.h>
-#include <asm/semaphore.h>
 
 #include "omap-audio-dma-intfc.h"
 #include "omap-audio.h"
@@ -438,7 +438,7 @@ int audio_register_codec(audio_state_t * codec_state)
        }
 
        memcpy(&audio_state, codec_state, sizeof(audio_state_t));
-       sema_init(&audio_state.sem, 1);
+       mutex_init(&audio_state.mutex);
 
        ret = platform_device_register(&omap_audio_device);
        if (ret != 0) {
@@ -1024,7 +1024,7 @@ static int audio_open(struct inode *inode, struct file *file)
                return -ESTALE;
        }
 
-       down(&state->sem);
+       mutex_lock(&state->mutex);
 
        /* access control */
        err = -ENODEV;
@@ -1092,7 +1092,7 @@ static int audio_open(struct inode *inode, struct file *file)
        err = 0;
 
       out:
-       up(&state->sem);
+       mutex_unlock(&state->mutex);
        if (err) {
                module_put(state->owner);
                module_put(THIS_MODULE);
@@ -1114,7 +1114,7 @@ static int audio_release(struct inode *inode, struct file *file)
 
        FN_IN;
 
-       down(&state->sem);
+       mutex_lock(&state->mutex);
 
        if (file->f_mode & FMODE_READ) {
                audio_discard_buf(is);
@@ -1145,7 +1145,7 @@ static int audio_release(struct inode *inode, struct file *file)
                        state->hw_shutdown(state->data);
        }
 
-       up(&state->sem);
+       mutex_unlock(&state->mutex);
 
        module_put(state->owner);
        module_put(THIS_MODULE);
index 58eff3130c36d7a8f1acf03a31a7cb3ad72dbf73..c039dee3b148c184dc0e14b539197012925792c4 100644 (file)
@@ -101,7 +101,7 @@ typedef struct {
        int (*hw_suspend) (void);
        int (*hw_resume) (void);
        struct pm_dev *pm_dev;
-       struct semaphore sem;   /* to protect against races in attach() */
+       struct mutex mutex;     /* to protect against races in attach() */
 } audio_state_t;
 
 #ifdef AUDIO_PM