diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-01-16 10:36:05 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-03-22 04:25:43 -0500 |
commit | 12aa757905d09b1dc2c1c3d0de3fa8f4c9726f2b (patch) | |
tree | c776b2b66618915502cb8c552fe6fc720a18306d /sound/sparc/cs4231.c | |
parent | 62932df8fb20ba2fb53a95fa52445eba22e821fe (diff) |
[ALSA] semaphore -> mutex (Archs, misc buses)
Semaphore to mutex conversion.
The conversion was generated via scripts, and the result was validated
automatically via a script as well.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/sparc/cs4231.c')
-rw-r--r-- | sound/sparc/cs4231.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c index fd6543998788..53a148b01b6b 100644 --- a/sound/sparc/cs4231.c +++ b/sound/sparc/cs4231.c | |||
@@ -115,8 +115,8 @@ struct snd_cs4231 { | |||
115 | unsigned char image[32]; /* registers image */ | 115 | unsigned char image[32]; /* registers image */ |
116 | int mce_bit; | 116 | int mce_bit; |
117 | int calibrate_mute; | 117 | int calibrate_mute; |
118 | struct semaphore mce_mutex; | 118 | struct mutex mce_mutex; |
119 | struct semaphore open_mutex; | 119 | struct mutex open_mutex; |
120 | 120 | ||
121 | union { | 121 | union { |
122 | #ifdef SBUS_SUPPORT | 122 | #ifdef SBUS_SUPPORT |
@@ -775,7 +775,7 @@ static void snd_cs4231_playback_format(struct snd_cs4231 *chip, struct snd_pcm_h | |||
775 | { | 775 | { |
776 | unsigned long flags; | 776 | unsigned long flags; |
777 | 777 | ||
778 | down(&chip->mce_mutex); | 778 | mutex_lock(&chip->mce_mutex); |
779 | snd_cs4231_calibrate_mute(chip, 1); | 779 | snd_cs4231_calibrate_mute(chip, 1); |
780 | 780 | ||
781 | snd_cs4231_mce_up(chip); | 781 | snd_cs4231_mce_up(chip); |
@@ -790,7 +790,7 @@ static void snd_cs4231_playback_format(struct snd_cs4231 *chip, struct snd_pcm_h | |||
790 | snd_cs4231_mce_down(chip); | 790 | snd_cs4231_mce_down(chip); |
791 | 791 | ||
792 | snd_cs4231_calibrate_mute(chip, 0); | 792 | snd_cs4231_calibrate_mute(chip, 0); |
793 | up(&chip->mce_mutex); | 793 | mutex_unlock(&chip->mce_mutex); |
794 | } | 794 | } |
795 | 795 | ||
796 | static void snd_cs4231_capture_format(struct snd_cs4231 *chip, struct snd_pcm_hw_params *params, | 796 | static void snd_cs4231_capture_format(struct snd_cs4231 *chip, struct snd_pcm_hw_params *params, |
@@ -798,7 +798,7 @@ static void snd_cs4231_capture_format(struct snd_cs4231 *chip, struct snd_pcm_hw | |||
798 | { | 798 | { |
799 | unsigned long flags; | 799 | unsigned long flags; |
800 | 800 | ||
801 | down(&chip->mce_mutex); | 801 | mutex_lock(&chip->mce_mutex); |
802 | snd_cs4231_calibrate_mute(chip, 1); | 802 | snd_cs4231_calibrate_mute(chip, 1); |
803 | 803 | ||
804 | snd_cs4231_mce_up(chip); | 804 | snd_cs4231_mce_up(chip); |
@@ -819,7 +819,7 @@ static void snd_cs4231_capture_format(struct snd_cs4231 *chip, struct snd_pcm_hw | |||
819 | snd_cs4231_mce_down(chip); | 819 | snd_cs4231_mce_down(chip); |
820 | 820 | ||
821 | snd_cs4231_calibrate_mute(chip, 0); | 821 | snd_cs4231_calibrate_mute(chip, 0); |
822 | up(&chip->mce_mutex); | 822 | mutex_unlock(&chip->mce_mutex); |
823 | } | 823 | } |
824 | 824 | ||
825 | /* | 825 | /* |
@@ -933,14 +933,14 @@ static int snd_cs4231_open(struct snd_cs4231 *chip, unsigned int mode) | |||
933 | { | 933 | { |
934 | unsigned long flags; | 934 | unsigned long flags; |
935 | 935 | ||
936 | down(&chip->open_mutex); | 936 | mutex_lock(&chip->open_mutex); |
937 | if ((chip->mode & mode)) { | 937 | if ((chip->mode & mode)) { |
938 | up(&chip->open_mutex); | 938 | mutex_unlock(&chip->open_mutex); |
939 | return -EAGAIN; | 939 | return -EAGAIN; |
940 | } | 940 | } |
941 | if (chip->mode & CS4231_MODE_OPEN) { | 941 | if (chip->mode & CS4231_MODE_OPEN) { |
942 | chip->mode |= mode; | 942 | chip->mode |= mode; |
943 | up(&chip->open_mutex); | 943 | mutex_unlock(&chip->open_mutex); |
944 | return 0; | 944 | return 0; |
945 | } | 945 | } |
946 | /* ok. now enable and ack CODEC IRQ */ | 946 | /* ok. now enable and ack CODEC IRQ */ |
@@ -960,7 +960,7 @@ static int snd_cs4231_open(struct snd_cs4231 *chip, unsigned int mode) | |||
960 | spin_unlock_irqrestore(&chip->lock, flags); | 960 | spin_unlock_irqrestore(&chip->lock, flags); |
961 | 961 | ||
962 | chip->mode = mode; | 962 | chip->mode = mode; |
963 | up(&chip->open_mutex); | 963 | mutex_unlock(&chip->open_mutex); |
964 | return 0; | 964 | return 0; |
965 | } | 965 | } |
966 | 966 | ||
@@ -968,10 +968,10 @@ static void snd_cs4231_close(struct snd_cs4231 *chip, unsigned int mode) | |||
968 | { | 968 | { |
969 | unsigned long flags; | 969 | unsigned long flags; |
970 | 970 | ||
971 | down(&chip->open_mutex); | 971 | mutex_lock(&chip->open_mutex); |
972 | chip->mode &= ~mode; | 972 | chip->mode &= ~mode; |
973 | if (chip->mode & CS4231_MODE_OPEN) { | 973 | if (chip->mode & CS4231_MODE_OPEN) { |
974 | up(&chip->open_mutex); | 974 | mutex_unlock(&chip->open_mutex); |
975 | return; | 975 | return; |
976 | } | 976 | } |
977 | snd_cs4231_calibrate_mute(chip, 1); | 977 | snd_cs4231_calibrate_mute(chip, 1); |
@@ -1008,7 +1008,7 @@ static void snd_cs4231_close(struct snd_cs4231 *chip, unsigned int mode) | |||
1008 | snd_cs4231_calibrate_mute(chip, 0); | 1008 | snd_cs4231_calibrate_mute(chip, 0); |
1009 | 1009 | ||
1010 | chip->mode = 0; | 1010 | chip->mode = 0; |
1011 | up(&chip->open_mutex); | 1011 | mutex_unlock(&chip->open_mutex); |
1012 | } | 1012 | } |
1013 | 1013 | ||
1014 | /* | 1014 | /* |
@@ -1969,8 +1969,8 @@ static int __init snd_cs4231_sbus_create(struct snd_card *card, | |||
1969 | spin_lock_init(&chip->lock); | 1969 | spin_lock_init(&chip->lock); |
1970 | spin_lock_init(&chip->c_dma.sbus_info.lock); | 1970 | spin_lock_init(&chip->c_dma.sbus_info.lock); |
1971 | spin_lock_init(&chip->p_dma.sbus_info.lock); | 1971 | spin_lock_init(&chip->p_dma.sbus_info.lock); |
1972 | init_MUTEX(&chip->mce_mutex); | 1972 | mutex_init(&chip->mce_mutex); |
1973 | init_MUTEX(&chip->open_mutex); | 1973 | mutex_init(&chip->open_mutex); |
1974 | chip->card = card; | 1974 | chip->card = card; |
1975 | chip->dev_u.sdev = sdev; | 1975 | chip->dev_u.sdev = sdev; |
1976 | chip->regs_size = sdev->reg_addrs[0].reg_size; | 1976 | chip->regs_size = sdev->reg_addrs[0].reg_size; |
@@ -2157,8 +2157,8 @@ static int __init snd_cs4231_ebus_create(struct snd_card *card, | |||
2157 | spin_lock_init(&chip->lock); | 2157 | spin_lock_init(&chip->lock); |
2158 | spin_lock_init(&chip->c_dma.ebus_info.lock); | 2158 | spin_lock_init(&chip->c_dma.ebus_info.lock); |
2159 | spin_lock_init(&chip->p_dma.ebus_info.lock); | 2159 | spin_lock_init(&chip->p_dma.ebus_info.lock); |
2160 | init_MUTEX(&chip->mce_mutex); | 2160 | mutex_init(&chip->mce_mutex); |
2161 | init_MUTEX(&chip->open_mutex); | 2161 | mutex_init(&chip->open_mutex); |
2162 | chip->flags |= CS4231_FLAG_EBUS; | 2162 | chip->flags |= CS4231_FLAG_EBUS; |
2163 | chip->card = card; | 2163 | chip->card = card; |
2164 | chip->dev_u.pdev = edev->bus->self; | 2164 | chip->dev_u.pdev = edev->bus->self; |