diff options
Diffstat (limited to 'sound/drivers')
-rw-r--r-- | sound/drivers/dummy.c | 4 | ||||
-rw-r--r-- | sound/drivers/mpu401/mpu401.c | 4 | ||||
-rw-r--r-- | sound/drivers/opl3/opl3_lib.c | 2 | ||||
-rw-r--r-- | sound/drivers/opl3/opl3_oss.c | 12 | ||||
-rw-r--r-- | sound/drivers/opl3/opl3_seq.c | 22 | ||||
-rw-r--r-- | sound/drivers/opl3/opl3_synth.c | 10 | ||||
-rw-r--r-- | sound/drivers/opl4/opl4_lib.c | 2 | ||||
-rw-r--r-- | sound/drivers/opl4/opl4_local.h | 2 | ||||
-rw-r--r-- | sound/drivers/opl4/opl4_proc.c | 10 | ||||
-rw-r--r-- | sound/drivers/opl4/opl4_seq.c | 12 | ||||
-rw-r--r-- | sound/drivers/serial-u16550.c | 5 | ||||
-rw-r--r-- | sound/drivers/virmidi.c | 4 | ||||
-rw-r--r-- | sound/drivers/vx/vx_core.c | 2 | ||||
-rw-r--r-- | sound/drivers/vx/vx_mixer.c | 72 | ||||
-rw-r--r-- | sound/drivers/vx/vx_pcm.c | 13 |
15 files changed, 98 insertions, 78 deletions
diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c index 14e1a671b5cf..e35fd5779a9d 100644 --- a/sound/drivers/dummy.c +++ b/sound/drivers/dummy.c | |||
@@ -669,8 +669,10 @@ static int __init alsa_card_dummy_init(void) | |||
669 | return err; | 669 | return err; |
670 | 670 | ||
671 | cards = 0; | 671 | cards = 0; |
672 | for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { | 672 | for (i = 0; i < SNDRV_CARDS; i++) { |
673 | struct platform_device *device; | 673 | struct platform_device *device; |
674 | if (! enable[i]) | ||
675 | continue; | ||
674 | device = platform_device_register_simple(SND_DUMMY_DRIVER, | 676 | device = platform_device_register_simple(SND_DUMMY_DRIVER, |
675 | i, NULL, 0); | 677 | i, NULL, 0); |
676 | if (IS_ERR(device)) { | 678 | if (IS_ERR(device)) { |
diff --git a/sound/drivers/mpu401/mpu401.c b/sound/drivers/mpu401/mpu401.c index 915589a402ab..9d10d79e27af 100644 --- a/sound/drivers/mpu401/mpu401.c +++ b/sound/drivers/mpu401/mpu401.c | |||
@@ -240,8 +240,10 @@ static int __init alsa_card_mpu401_init(void) | |||
240 | return err; | 240 | return err; |
241 | 241 | ||
242 | devices = 0; | 242 | devices = 0; |
243 | for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { | 243 | for (i = 0; i < SNDRV_CARDS; i++) { |
244 | struct platform_device *device; | 244 | struct platform_device *device; |
245 | if (! enable[i]) | ||
246 | continue; | ||
245 | #ifdef CONFIG_PNP | 247 | #ifdef CONFIG_PNP |
246 | if (pnp[i]) | 248 | if (pnp[i]) |
247 | continue; | 249 | continue; |
diff --git a/sound/drivers/opl3/opl3_lib.c b/sound/drivers/opl3/opl3_lib.c index 1e0c76b9acfc..4f8556976774 100644 --- a/sound/drivers/opl3/opl3_lib.c +++ b/sound/drivers/opl3/opl3_lib.c | |||
@@ -358,7 +358,7 @@ int snd_opl3_new(struct snd_card *card, | |||
358 | opl3->hardware = hardware; | 358 | opl3->hardware = hardware; |
359 | spin_lock_init(&opl3->reg_lock); | 359 | spin_lock_init(&opl3->reg_lock); |
360 | spin_lock_init(&opl3->timer_lock); | 360 | spin_lock_init(&opl3->timer_lock); |
361 | init_MUTEX(&opl3->access_mutex); | 361 | mutex_init(&opl3->access_mutex); |
362 | 362 | ||
363 | if ((err = snd_device_new(card, SNDRV_DEV_CODEC, opl3, &ops)) < 0) { | 363 | if ((err = snd_device_new(card, SNDRV_DEV_CODEC, opl3, &ops)) < 0) { |
364 | snd_opl3_free(opl3); | 364 | snd_opl3_free(opl3); |
diff --git a/sound/drivers/opl3/opl3_oss.c b/sound/drivers/opl3/opl3_oss.c index 0345ae647681..fccf019a6d85 100644 --- a/sound/drivers/opl3/opl3_oss.c +++ b/sound/drivers/opl3/opl3_oss.c | |||
@@ -104,8 +104,10 @@ static int snd_opl3_oss_create_port(struct snd_opl3 * opl3) | |||
104 | voices, voices, | 104 | voices, voices, |
105 | name); | 105 | name); |
106 | if (opl3->oss_chset->port < 0) { | 106 | if (opl3->oss_chset->port < 0) { |
107 | int port; | ||
108 | port = opl3->oss_chset->port; | ||
107 | snd_midi_channel_free_set(opl3->oss_chset); | 109 | snd_midi_channel_free_set(opl3->oss_chset); |
108 | return opl3->oss_chset->port; | 110 | return port; |
109 | } | 111 | } |
110 | return 0; | 112 | return 0; |
111 | } | 113 | } |
@@ -136,10 +138,10 @@ void snd_opl3_init_seq_oss(struct snd_opl3 *opl3, char *name) | |||
136 | arg->oper = oss_callback; | 138 | arg->oper = oss_callback; |
137 | arg->private_data = opl3; | 139 | arg->private_data = opl3; |
138 | 140 | ||
139 | snd_opl3_oss_create_port(opl3); | 141 | if (snd_opl3_oss_create_port(opl3)) { |
140 | 142 | /* register to OSS synth table */ | |
141 | /* register to OSS synth table */ | 143 | snd_device_register(opl3->card, dev); |
142 | snd_device_register(opl3->card, dev); | 144 | } |
143 | } | 145 | } |
144 | 146 | ||
145 | /* unregister */ | 147 | /* unregister */ |
diff --git a/sound/drivers/opl3/opl3_seq.c b/sound/drivers/opl3/opl3_seq.c index c4ead790008a..57becf34f43e 100644 --- a/sound/drivers/opl3/opl3_seq.c +++ b/sound/drivers/opl3/opl3_seq.c | |||
@@ -52,13 +52,13 @@ int snd_opl3_synth_setup(struct snd_opl3 * opl3) | |||
52 | { | 52 | { |
53 | int idx; | 53 | int idx; |
54 | 54 | ||
55 | down(&opl3->access_mutex); | 55 | mutex_lock(&opl3->access_mutex); |
56 | if (opl3->used) { | 56 | if (opl3->used) { |
57 | up(&opl3->access_mutex); | 57 | mutex_unlock(&opl3->access_mutex); |
58 | return -EBUSY; | 58 | return -EBUSY; |
59 | } | 59 | } |
60 | opl3->used++; | 60 | opl3->used++; |
61 | up(&opl3->access_mutex); | 61 | mutex_unlock(&opl3->access_mutex); |
62 | 62 | ||
63 | snd_opl3_reset(opl3); | 63 | snd_opl3_reset(opl3); |
64 | 64 | ||
@@ -91,9 +91,9 @@ void snd_opl3_synth_cleanup(struct snd_opl3 * opl3) | |||
91 | spin_unlock_irqrestore(&opl3->sys_timer_lock, flags); | 91 | spin_unlock_irqrestore(&opl3->sys_timer_lock, flags); |
92 | 92 | ||
93 | snd_opl3_reset(opl3); | 93 | snd_opl3_reset(opl3); |
94 | down(&opl3->access_mutex); | 94 | mutex_lock(&opl3->access_mutex); |
95 | opl3->used--; | 95 | opl3->used--; |
96 | up(&opl3->access_mutex); | 96 | mutex_unlock(&opl3->access_mutex); |
97 | } | 97 | } |
98 | 98 | ||
99 | static int snd_opl3_synth_use(void *private_data, struct snd_seq_port_subscribe * info) | 99 | static int snd_opl3_synth_use(void *private_data, struct snd_seq_port_subscribe * info) |
@@ -207,8 +207,10 @@ static int snd_opl3_synth_create_port(struct snd_opl3 * opl3) | |||
207 | 16, voices, | 207 | 16, voices, |
208 | name); | 208 | name); |
209 | if (opl3->chset->port < 0) { | 209 | if (opl3->chset->port < 0) { |
210 | int port; | ||
211 | port = opl3->chset->port; | ||
210 | snd_midi_channel_free_set(opl3->chset); | 212 | snd_midi_channel_free_set(opl3->chset); |
211 | return opl3->chset->port; | 213 | return port; |
212 | } | 214 | } |
213 | return 0; | 215 | return 0; |
214 | } | 216 | } |
@@ -218,7 +220,7 @@ static int snd_opl3_synth_create_port(struct snd_opl3 * opl3) | |||
218 | static int snd_opl3_seq_new_device(struct snd_seq_device *dev) | 220 | static int snd_opl3_seq_new_device(struct snd_seq_device *dev) |
219 | { | 221 | { |
220 | struct snd_opl3 *opl3; | 222 | struct snd_opl3 *opl3; |
221 | int client; | 223 | int client, err; |
222 | char name[32]; | 224 | char name[32]; |
223 | int opl_ver; | 225 | int opl_ver; |
224 | 226 | ||
@@ -239,7 +241,11 @@ static int snd_opl3_seq_new_device(struct snd_seq_device *dev) | |||
239 | if (client < 0) | 241 | if (client < 0) |
240 | return client; | 242 | return client; |
241 | 243 | ||
242 | snd_opl3_synth_create_port(opl3); | 244 | if ((err = snd_opl3_synth_create_port(opl3)) < 0) { |
245 | snd_seq_delete_kernel_client(client); | ||
246 | opl3->seq_client = -1; | ||
247 | return err; | ||
248 | } | ||
243 | 249 | ||
244 | /* initialize instrument list */ | 250 | /* initialize instrument list */ |
245 | opl3->ilist = snd_seq_instr_list_new(); | 251 | opl3->ilist = snd_seq_instr_list_new(); |
diff --git a/sound/drivers/opl3/opl3_synth.c b/sound/drivers/opl3/opl3_synth.c index 3534a0e3342a..6db503f025b3 100644 --- a/sound/drivers/opl3/opl3_synth.c +++ b/sound/drivers/opl3/opl3_synth.c | |||
@@ -76,13 +76,13 @@ int snd_opl3_open(struct snd_hwdep * hw, struct file *file) | |||
76 | { | 76 | { |
77 | struct snd_opl3 *opl3 = hw->private_data; | 77 | struct snd_opl3 *opl3 = hw->private_data; |
78 | 78 | ||
79 | down(&opl3->access_mutex); | 79 | mutex_lock(&opl3->access_mutex); |
80 | if (opl3->used) { | 80 | if (opl3->used) { |
81 | up(&opl3->access_mutex); | 81 | mutex_unlock(&opl3->access_mutex); |
82 | return -EAGAIN; | 82 | return -EAGAIN; |
83 | } | 83 | } |
84 | opl3->used++; | 84 | opl3->used++; |
85 | up(&opl3->access_mutex); | 85 | mutex_unlock(&opl3->access_mutex); |
86 | 86 | ||
87 | return 0; | 87 | return 0; |
88 | } | 88 | } |
@@ -179,9 +179,9 @@ int snd_opl3_release(struct snd_hwdep * hw, struct file *file) | |||
179 | struct snd_opl3 *opl3 = hw->private_data; | 179 | struct snd_opl3 *opl3 = hw->private_data; |
180 | 180 | ||
181 | snd_opl3_reset(opl3); | 181 | snd_opl3_reset(opl3); |
182 | down(&opl3->access_mutex); | 182 | mutex_lock(&opl3->access_mutex); |
183 | opl3->used--; | 183 | opl3->used--; |
184 | up(&opl3->access_mutex); | 184 | mutex_unlock(&opl3->access_mutex); |
185 | 185 | ||
186 | return 0; | 186 | return 0; |
187 | } | 187 | } |
diff --git a/sound/drivers/opl4/opl4_lib.c b/sound/drivers/opl4/opl4_lib.c index ddfc10d04be2..4bc860ae02de 100644 --- a/sound/drivers/opl4/opl4_lib.c +++ b/sound/drivers/opl4/opl4_lib.c | |||
@@ -214,7 +214,7 @@ int snd_opl4_create(struct snd_card *card, | |||
214 | opl4->fm_port = fm_port; | 214 | opl4->fm_port = fm_port; |
215 | opl4->pcm_port = pcm_port; | 215 | opl4->pcm_port = pcm_port; |
216 | spin_lock_init(&opl4->reg_lock); | 216 | spin_lock_init(&opl4->reg_lock); |
217 | init_MUTEX(&opl4->access_mutex); | 217 | mutex_init(&opl4->access_mutex); |
218 | 218 | ||
219 | err = snd_opl4_detect(opl4); | 219 | err = snd_opl4_detect(opl4); |
220 | if (err < 0) { | 220 | if (err < 0) { |
diff --git a/sound/drivers/opl4/opl4_local.h b/sound/drivers/opl4/opl4_local.h index 7e088a4a2f4c..470e5a758a02 100644 --- a/sound/drivers/opl4/opl4_local.h +++ b/sound/drivers/opl4/opl4_local.h | |||
@@ -182,7 +182,7 @@ struct snd_opl4 { | |||
182 | struct snd_info_entry *proc_entry; | 182 | struct snd_info_entry *proc_entry; |
183 | int memory_access; | 183 | int memory_access; |
184 | #endif | 184 | #endif |
185 | struct semaphore access_mutex; | 185 | struct mutex access_mutex; |
186 | 186 | ||
187 | #if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE) | 187 | #if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE) |
188 | int used; | 188 | int used; |
diff --git a/sound/drivers/opl4/opl4_proc.c b/sound/drivers/opl4/opl4_proc.c index f4b4e74fcc18..e552ec34166f 100644 --- a/sound/drivers/opl4/opl4_proc.c +++ b/sound/drivers/opl4/opl4_proc.c | |||
@@ -28,13 +28,13 @@ static int snd_opl4_mem_proc_open(struct snd_info_entry *entry, | |||
28 | { | 28 | { |
29 | struct snd_opl4 *opl4 = entry->private_data; | 29 | struct snd_opl4 *opl4 = entry->private_data; |
30 | 30 | ||
31 | down(&opl4->access_mutex); | 31 | mutex_lock(&opl4->access_mutex); |
32 | if (opl4->memory_access) { | 32 | if (opl4->memory_access) { |
33 | up(&opl4->access_mutex); | 33 | mutex_unlock(&opl4->access_mutex); |
34 | return -EBUSY; | 34 | return -EBUSY; |
35 | } | 35 | } |
36 | opl4->memory_access++; | 36 | opl4->memory_access++; |
37 | up(&opl4->access_mutex); | 37 | mutex_unlock(&opl4->access_mutex); |
38 | return 0; | 38 | return 0; |
39 | } | 39 | } |
40 | 40 | ||
@@ -43,9 +43,9 @@ static int snd_opl4_mem_proc_release(struct snd_info_entry *entry, | |||
43 | { | 43 | { |
44 | struct snd_opl4 *opl4 = entry->private_data; | 44 | struct snd_opl4 *opl4 = entry->private_data; |
45 | 45 | ||
46 | down(&opl4->access_mutex); | 46 | mutex_lock(&opl4->access_mutex); |
47 | opl4->memory_access--; | 47 | opl4->memory_access--; |
48 | up(&opl4->access_mutex); | 48 | mutex_unlock(&opl4->access_mutex); |
49 | return 0; | 49 | return 0; |
50 | } | 50 | } |
51 | 51 | ||
diff --git a/sound/drivers/opl4/opl4_seq.c b/sound/drivers/opl4/opl4_seq.c index e3480326e735..dc0dcdc6c313 100644 --- a/sound/drivers/opl4/opl4_seq.c +++ b/sound/drivers/opl4/opl4_seq.c | |||
@@ -62,10 +62,10 @@ static int snd_opl4_seq_use(void *private_data, struct snd_seq_port_subscribe *i | |||
62 | struct snd_opl4 *opl4 = private_data; | 62 | struct snd_opl4 *opl4 = private_data; |
63 | int err; | 63 | int err; |
64 | 64 | ||
65 | down(&opl4->access_mutex); | 65 | mutex_lock(&opl4->access_mutex); |
66 | 66 | ||
67 | if (opl4->used) { | 67 | if (opl4->used) { |
68 | up(&opl4->access_mutex); | 68 | mutex_unlock(&opl4->access_mutex); |
69 | return -EBUSY; | 69 | return -EBUSY; |
70 | } | 70 | } |
71 | opl4->used++; | 71 | opl4->used++; |
@@ -73,12 +73,12 @@ static int snd_opl4_seq_use(void *private_data, struct snd_seq_port_subscribe *i | |||
73 | if (info->sender.client != SNDRV_SEQ_CLIENT_SYSTEM) { | 73 | if (info->sender.client != SNDRV_SEQ_CLIENT_SYSTEM) { |
74 | err = snd_opl4_seq_use_inc(opl4); | 74 | err = snd_opl4_seq_use_inc(opl4); |
75 | if (err < 0) { | 75 | if (err < 0) { |
76 | up(&opl4->access_mutex); | 76 | mutex_unlock(&opl4->access_mutex); |
77 | return err; | 77 | return err; |
78 | } | 78 | } |
79 | } | 79 | } |
80 | 80 | ||
81 | up(&opl4->access_mutex); | 81 | mutex_unlock(&opl4->access_mutex); |
82 | 82 | ||
83 | snd_opl4_synth_reset(opl4); | 83 | snd_opl4_synth_reset(opl4); |
84 | return 0; | 84 | return 0; |
@@ -90,9 +90,9 @@ static int snd_opl4_seq_unuse(void *private_data, struct snd_seq_port_subscribe | |||
90 | 90 | ||
91 | snd_opl4_synth_shutdown(opl4); | 91 | snd_opl4_synth_shutdown(opl4); |
92 | 92 | ||
93 | down(&opl4->access_mutex); | 93 | mutex_lock(&opl4->access_mutex); |
94 | opl4->used--; | 94 | opl4->used--; |
95 | up(&opl4->access_mutex); | 95 | mutex_unlock(&opl4->access_mutex); |
96 | 96 | ||
97 | if (info->sender.client != SNDRV_SEQ_CLIENT_SYSTEM) | 97 | if (info->sender.client != SNDRV_SEQ_CLIENT_SYSTEM) |
98 | snd_opl4_seq_use_dec(opl4); | 98 | snd_opl4_seq_use_dec(opl4); |
diff --git a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c index 112ddf705402..1a7fbefe4740 100644 --- a/sound/drivers/serial-u16550.c +++ b/sound/drivers/serial-u16550.c | |||
@@ -789,6 +789,7 @@ static int __init snd_uart16550_create(struct snd_card *card, | |||
789 | 789 | ||
790 | if ((err = snd_uart16550_detect(uart)) <= 0) { | 790 | if ((err = snd_uart16550_detect(uart)) <= 0) { |
791 | printk(KERN_ERR "no UART detected at 0x%lx\n", iobase); | 791 | printk(KERN_ERR "no UART detected at 0x%lx\n", iobase); |
792 | snd_uart16550_free(uart); | ||
792 | return -ENODEV; | 793 | return -ENODEV; |
793 | } | 794 | } |
794 | 795 | ||
@@ -989,8 +990,10 @@ static int __init alsa_card_serial_init(void) | |||
989 | return err; | 990 | return err; |
990 | 991 | ||
991 | cards = 0; | 992 | cards = 0; |
992 | for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { | 993 | for (i = 0; i < SNDRV_CARDS; i++) { |
993 | struct platform_device *device; | 994 | struct platform_device *device; |
995 | if (! enable[i]) | ||
996 | continue; | ||
994 | device = platform_device_register_simple(SND_SERIAL_DRIVER, | 997 | device = platform_device_register_simple(SND_SERIAL_DRIVER, |
995 | i, NULL, 0); | 998 | i, NULL, 0); |
996 | if (IS_ERR(device)) { | 999 | if (IS_ERR(device)) { |
diff --git a/sound/drivers/virmidi.c b/sound/drivers/virmidi.c index 4258723de2ab..a3ee306239c9 100644 --- a/sound/drivers/virmidi.c +++ b/sound/drivers/virmidi.c | |||
@@ -163,8 +163,10 @@ static int __init alsa_card_virmidi_init(void) | |||
163 | return err; | 163 | return err; |
164 | 164 | ||
165 | cards = 0; | 165 | cards = 0; |
166 | for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { | 166 | for (i = 0; i < SNDRV_CARDS; i++) { |
167 | struct platform_device *device; | 167 | struct platform_device *device; |
168 | if (! enable[i]) | ||
169 | continue; | ||
168 | device = platform_device_register_simple(SND_VIRMIDI_DRIVER, | 170 | device = platform_device_register_simple(SND_VIRMIDI_DRIVER, |
169 | i, NULL, 0); | 171 | i, NULL, 0); |
170 | if (IS_ERR(device)) { | 172 | if (IS_ERR(device)) { |
diff --git a/sound/drivers/vx/vx_core.c b/sound/drivers/vx/vx_core.c index 43f615d7a545..fa4a2b5c2d8d 100644 --- a/sound/drivers/vx/vx_core.c +++ b/sound/drivers/vx/vx_core.c | |||
@@ -778,7 +778,7 @@ struct vx_core *snd_vx_create(struct snd_card *card, struct snd_vx_hardware *hw, | |||
778 | chip->type = hw->type; | 778 | chip->type = hw->type; |
779 | chip->ops = ops; | 779 | chip->ops = ops; |
780 | tasklet_init(&chip->tq, vx_interrupt, (unsigned long)chip); | 780 | tasklet_init(&chip->tq, vx_interrupt, (unsigned long)chip); |
781 | init_MUTEX(&chip->mixer_mutex); | 781 | mutex_init(&chip->mixer_mutex); |
782 | 782 | ||
783 | chip->card = card; | 783 | chip->card = card; |
784 | card->private_data = chip; | 784 | card->private_data = chip; |
diff --git a/sound/drivers/vx/vx_mixer.c b/sound/drivers/vx/vx_mixer.c index 8ec2c605d2f0..c1d7fcdd1973 100644 --- a/sound/drivers/vx/vx_mixer.c +++ b/sound/drivers/vx/vx_mixer.c | |||
@@ -427,10 +427,10 @@ static int vx_output_level_get(struct snd_kcontrol *kcontrol, struct snd_ctl_ele | |||
427 | { | 427 | { |
428 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); | 428 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); |
429 | int codec = kcontrol->id.index; | 429 | int codec = kcontrol->id.index; |
430 | down(&chip->mixer_mutex); | 430 | mutex_lock(&chip->mixer_mutex); |
431 | ucontrol->value.integer.value[0] = chip->output_level[codec][0]; | 431 | ucontrol->value.integer.value[0] = chip->output_level[codec][0]; |
432 | ucontrol->value.integer.value[1] = chip->output_level[codec][1]; | 432 | ucontrol->value.integer.value[1] = chip->output_level[codec][1]; |
433 | up(&chip->mixer_mutex); | 433 | mutex_unlock(&chip->mixer_mutex); |
434 | return 0; | 434 | return 0; |
435 | } | 435 | } |
436 | 436 | ||
@@ -438,7 +438,7 @@ static int vx_output_level_put(struct snd_kcontrol *kcontrol, struct snd_ctl_ele | |||
438 | { | 438 | { |
439 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); | 439 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); |
440 | int codec = kcontrol->id.index; | 440 | int codec = kcontrol->id.index; |
441 | down(&chip->mixer_mutex); | 441 | mutex_lock(&chip->mixer_mutex); |
442 | if (ucontrol->value.integer.value[0] != chip->output_level[codec][0] || | 442 | if (ucontrol->value.integer.value[0] != chip->output_level[codec][0] || |
443 | ucontrol->value.integer.value[1] != chip->output_level[codec][1]) { | 443 | ucontrol->value.integer.value[1] != chip->output_level[codec][1]) { |
444 | vx_set_analog_output_level(chip, codec, | 444 | vx_set_analog_output_level(chip, codec, |
@@ -446,10 +446,10 @@ static int vx_output_level_put(struct snd_kcontrol *kcontrol, struct snd_ctl_ele | |||
446 | ucontrol->value.integer.value[1]); | 446 | ucontrol->value.integer.value[1]); |
447 | chip->output_level[codec][0] = ucontrol->value.integer.value[0]; | 447 | chip->output_level[codec][0] = ucontrol->value.integer.value[0]; |
448 | chip->output_level[codec][1] = ucontrol->value.integer.value[1]; | 448 | chip->output_level[codec][1] = ucontrol->value.integer.value[1]; |
449 | up(&chip->mixer_mutex); | 449 | mutex_unlock(&chip->mixer_mutex); |
450 | return 1; | 450 | return 1; |
451 | } | 451 | } |
452 | up(&chip->mixer_mutex); | 452 | mutex_unlock(&chip->mixer_mutex); |
453 | return 0; | 453 | return 0; |
454 | } | 454 | } |
455 | 455 | ||
@@ -502,14 +502,14 @@ static int vx_audio_src_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_v | |||
502 | static int vx_audio_src_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 502 | static int vx_audio_src_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
503 | { | 503 | { |
504 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); | 504 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); |
505 | down(&chip->mixer_mutex); | 505 | mutex_lock(&chip->mixer_mutex); |
506 | if (chip->audio_source_target != ucontrol->value.enumerated.item[0]) { | 506 | if (chip->audio_source_target != ucontrol->value.enumerated.item[0]) { |
507 | chip->audio_source_target = ucontrol->value.enumerated.item[0]; | 507 | chip->audio_source_target = ucontrol->value.enumerated.item[0]; |
508 | vx_sync_audio_source(chip); | 508 | vx_sync_audio_source(chip); |
509 | up(&chip->mixer_mutex); | 509 | mutex_unlock(&chip->mixer_mutex); |
510 | return 1; | 510 | return 1; |
511 | } | 511 | } |
512 | up(&chip->mixer_mutex); | 512 | mutex_unlock(&chip->mixer_mutex); |
513 | return 0; | 513 | return 0; |
514 | } | 514 | } |
515 | 515 | ||
@@ -550,14 +550,14 @@ static int vx_clock_mode_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_ | |||
550 | static int vx_clock_mode_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 550 | static int vx_clock_mode_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
551 | { | 551 | { |
552 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); | 552 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); |
553 | down(&chip->mixer_mutex); | 553 | mutex_lock(&chip->mixer_mutex); |
554 | if (chip->clock_mode != ucontrol->value.enumerated.item[0]) { | 554 | if (chip->clock_mode != ucontrol->value.enumerated.item[0]) { |
555 | chip->clock_mode = ucontrol->value.enumerated.item[0]; | 555 | chip->clock_mode = ucontrol->value.enumerated.item[0]; |
556 | vx_set_clock(chip, chip->freq); | 556 | vx_set_clock(chip, chip->freq); |
557 | up(&chip->mixer_mutex); | 557 | mutex_unlock(&chip->mixer_mutex); |
558 | return 1; | 558 | return 1; |
559 | } | 559 | } |
560 | up(&chip->mixer_mutex); | 560 | mutex_unlock(&chip->mixer_mutex); |
561 | return 0; | 561 | return 0; |
562 | } | 562 | } |
563 | 563 | ||
@@ -587,10 +587,10 @@ static int vx_audio_gain_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_ | |||
587 | int audio = kcontrol->private_value & 0xff; | 587 | int audio = kcontrol->private_value & 0xff; |
588 | int capture = (kcontrol->private_value >> 8) & 1; | 588 | int capture = (kcontrol->private_value >> 8) & 1; |
589 | 589 | ||
590 | down(&chip->mixer_mutex); | 590 | mutex_lock(&chip->mixer_mutex); |
591 | ucontrol->value.integer.value[0] = chip->audio_gain[capture][audio]; | 591 | ucontrol->value.integer.value[0] = chip->audio_gain[capture][audio]; |
592 | ucontrol->value.integer.value[1] = chip->audio_gain[capture][audio+1]; | 592 | ucontrol->value.integer.value[1] = chip->audio_gain[capture][audio+1]; |
593 | up(&chip->mixer_mutex); | 593 | mutex_unlock(&chip->mixer_mutex); |
594 | return 0; | 594 | return 0; |
595 | } | 595 | } |
596 | 596 | ||
@@ -600,15 +600,15 @@ static int vx_audio_gain_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_ | |||
600 | int audio = kcontrol->private_value & 0xff; | 600 | int audio = kcontrol->private_value & 0xff; |
601 | int capture = (kcontrol->private_value >> 8) & 1; | 601 | int capture = (kcontrol->private_value >> 8) & 1; |
602 | 602 | ||
603 | down(&chip->mixer_mutex); | 603 | mutex_lock(&chip->mixer_mutex); |
604 | if (ucontrol->value.integer.value[0] != chip->audio_gain[capture][audio] || | 604 | if (ucontrol->value.integer.value[0] != chip->audio_gain[capture][audio] || |
605 | ucontrol->value.integer.value[1] != chip->audio_gain[capture][audio+1]) { | 605 | ucontrol->value.integer.value[1] != chip->audio_gain[capture][audio+1]) { |
606 | vx_set_audio_gain(chip, audio, capture, ucontrol->value.integer.value[0]); | 606 | vx_set_audio_gain(chip, audio, capture, ucontrol->value.integer.value[0]); |
607 | vx_set_audio_gain(chip, audio+1, capture, ucontrol->value.integer.value[1]); | 607 | vx_set_audio_gain(chip, audio+1, capture, ucontrol->value.integer.value[1]); |
608 | up(&chip->mixer_mutex); | 608 | mutex_unlock(&chip->mixer_mutex); |
609 | return 1; | 609 | return 1; |
610 | } | 610 | } |
611 | up(&chip->mixer_mutex); | 611 | mutex_unlock(&chip->mixer_mutex); |
612 | return 0; | 612 | return 0; |
613 | } | 613 | } |
614 | 614 | ||
@@ -617,10 +617,10 @@ static int vx_audio_monitor_get(struct snd_kcontrol *kcontrol, struct snd_ctl_el | |||
617 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); | 617 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); |
618 | int audio = kcontrol->private_value & 0xff; | 618 | int audio = kcontrol->private_value & 0xff; |
619 | 619 | ||
620 | down(&chip->mixer_mutex); | 620 | mutex_lock(&chip->mixer_mutex); |
621 | ucontrol->value.integer.value[0] = chip->audio_monitor[audio]; | 621 | ucontrol->value.integer.value[0] = chip->audio_monitor[audio]; |
622 | ucontrol->value.integer.value[1] = chip->audio_monitor[audio+1]; | 622 | ucontrol->value.integer.value[1] = chip->audio_monitor[audio+1]; |
623 | up(&chip->mixer_mutex); | 623 | mutex_unlock(&chip->mixer_mutex); |
624 | return 0; | 624 | return 0; |
625 | } | 625 | } |
626 | 626 | ||
@@ -629,17 +629,17 @@ static int vx_audio_monitor_put(struct snd_kcontrol *kcontrol, struct snd_ctl_el | |||
629 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); | 629 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); |
630 | int audio = kcontrol->private_value & 0xff; | 630 | int audio = kcontrol->private_value & 0xff; |
631 | 631 | ||
632 | down(&chip->mixer_mutex); | 632 | mutex_lock(&chip->mixer_mutex); |
633 | if (ucontrol->value.integer.value[0] != chip->audio_monitor[audio] || | 633 | if (ucontrol->value.integer.value[0] != chip->audio_monitor[audio] || |
634 | ucontrol->value.integer.value[1] != chip->audio_monitor[audio+1]) { | 634 | ucontrol->value.integer.value[1] != chip->audio_monitor[audio+1]) { |
635 | vx_set_monitor_level(chip, audio, ucontrol->value.integer.value[0], | 635 | vx_set_monitor_level(chip, audio, ucontrol->value.integer.value[0], |
636 | chip->audio_monitor_active[audio]); | 636 | chip->audio_monitor_active[audio]); |
637 | vx_set_monitor_level(chip, audio+1, ucontrol->value.integer.value[1], | 637 | vx_set_monitor_level(chip, audio+1, ucontrol->value.integer.value[1], |
638 | chip->audio_monitor_active[audio+1]); | 638 | chip->audio_monitor_active[audio+1]); |
639 | up(&chip->mixer_mutex); | 639 | mutex_unlock(&chip->mixer_mutex); |
640 | return 1; | 640 | return 1; |
641 | } | 641 | } |
642 | up(&chip->mixer_mutex); | 642 | mutex_unlock(&chip->mixer_mutex); |
643 | return 0; | 643 | return 0; |
644 | } | 644 | } |
645 | 645 | ||
@@ -657,10 +657,10 @@ static int vx_audio_sw_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_va | |||
657 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); | 657 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); |
658 | int audio = kcontrol->private_value & 0xff; | 658 | int audio = kcontrol->private_value & 0xff; |
659 | 659 | ||
660 | down(&chip->mixer_mutex); | 660 | mutex_lock(&chip->mixer_mutex); |
661 | ucontrol->value.integer.value[0] = chip->audio_active[audio]; | 661 | ucontrol->value.integer.value[0] = chip->audio_active[audio]; |
662 | ucontrol->value.integer.value[1] = chip->audio_active[audio+1]; | 662 | ucontrol->value.integer.value[1] = chip->audio_active[audio+1]; |
663 | up(&chip->mixer_mutex); | 663 | mutex_unlock(&chip->mixer_mutex); |
664 | return 0; | 664 | return 0; |
665 | } | 665 | } |
666 | 666 | ||
@@ -669,15 +669,15 @@ static int vx_audio_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_va | |||
669 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); | 669 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); |
670 | int audio = kcontrol->private_value & 0xff; | 670 | int audio = kcontrol->private_value & 0xff; |
671 | 671 | ||
672 | down(&chip->mixer_mutex); | 672 | mutex_lock(&chip->mixer_mutex); |
673 | if (ucontrol->value.integer.value[0] != chip->audio_active[audio] || | 673 | if (ucontrol->value.integer.value[0] != chip->audio_active[audio] || |
674 | ucontrol->value.integer.value[1] != chip->audio_active[audio+1]) { | 674 | ucontrol->value.integer.value[1] != chip->audio_active[audio+1]) { |
675 | vx_set_audio_switch(chip, audio, ucontrol->value.integer.value[0]); | 675 | vx_set_audio_switch(chip, audio, ucontrol->value.integer.value[0]); |
676 | vx_set_audio_switch(chip, audio+1, ucontrol->value.integer.value[1]); | 676 | vx_set_audio_switch(chip, audio+1, ucontrol->value.integer.value[1]); |
677 | up(&chip->mixer_mutex); | 677 | mutex_unlock(&chip->mixer_mutex); |
678 | return 1; | 678 | return 1; |
679 | } | 679 | } |
680 | up(&chip->mixer_mutex); | 680 | mutex_unlock(&chip->mixer_mutex); |
681 | return 0; | 681 | return 0; |
682 | } | 682 | } |
683 | 683 | ||
@@ -686,10 +686,10 @@ static int vx_monitor_sw_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_ | |||
686 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); | 686 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); |
687 | int audio = kcontrol->private_value & 0xff; | 687 | int audio = kcontrol->private_value & 0xff; |
688 | 688 | ||
689 | down(&chip->mixer_mutex); | 689 | mutex_lock(&chip->mixer_mutex); |
690 | ucontrol->value.integer.value[0] = chip->audio_monitor_active[audio]; | 690 | ucontrol->value.integer.value[0] = chip->audio_monitor_active[audio]; |
691 | ucontrol->value.integer.value[1] = chip->audio_monitor_active[audio+1]; | 691 | ucontrol->value.integer.value[1] = chip->audio_monitor_active[audio+1]; |
692 | up(&chip->mixer_mutex); | 692 | mutex_unlock(&chip->mixer_mutex); |
693 | return 0; | 693 | return 0; |
694 | } | 694 | } |
695 | 695 | ||
@@ -698,17 +698,17 @@ static int vx_monitor_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_ | |||
698 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); | 698 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); |
699 | int audio = kcontrol->private_value & 0xff; | 699 | int audio = kcontrol->private_value & 0xff; |
700 | 700 | ||
701 | down(&chip->mixer_mutex); | 701 | mutex_lock(&chip->mixer_mutex); |
702 | if (ucontrol->value.integer.value[0] != chip->audio_monitor_active[audio] || | 702 | if (ucontrol->value.integer.value[0] != chip->audio_monitor_active[audio] || |
703 | ucontrol->value.integer.value[1] != chip->audio_monitor_active[audio+1]) { | 703 | ucontrol->value.integer.value[1] != chip->audio_monitor_active[audio+1]) { |
704 | vx_set_monitor_level(chip, audio, chip->audio_monitor[audio], | 704 | vx_set_monitor_level(chip, audio, chip->audio_monitor[audio], |
705 | ucontrol->value.integer.value[0]); | 705 | ucontrol->value.integer.value[0]); |
706 | vx_set_monitor_level(chip, audio+1, chip->audio_monitor[audio+1], | 706 | vx_set_monitor_level(chip, audio+1, chip->audio_monitor[audio+1], |
707 | ucontrol->value.integer.value[1]); | 707 | ucontrol->value.integer.value[1]); |
708 | up(&chip->mixer_mutex); | 708 | mutex_unlock(&chip->mixer_mutex); |
709 | return 1; | 709 | return 1; |
710 | } | 710 | } |
711 | up(&chip->mixer_mutex); | 711 | mutex_unlock(&chip->mixer_mutex); |
712 | return 0; | 712 | return 0; |
713 | } | 713 | } |
714 | 714 | ||
@@ -756,12 +756,12 @@ static int vx_iec958_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_valu | |||
756 | { | 756 | { |
757 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); | 757 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); |
758 | 758 | ||
759 | down(&chip->mixer_mutex); | 759 | mutex_lock(&chip->mixer_mutex); |
760 | ucontrol->value.iec958.status[0] = (chip->uer_bits >> 0) & 0xff; | 760 | ucontrol->value.iec958.status[0] = (chip->uer_bits >> 0) & 0xff; |
761 | ucontrol->value.iec958.status[1] = (chip->uer_bits >> 8) & 0xff; | 761 | ucontrol->value.iec958.status[1] = (chip->uer_bits >> 8) & 0xff; |
762 | ucontrol->value.iec958.status[2] = (chip->uer_bits >> 16) & 0xff; | 762 | ucontrol->value.iec958.status[2] = (chip->uer_bits >> 16) & 0xff; |
763 | ucontrol->value.iec958.status[3] = (chip->uer_bits >> 24) & 0xff; | 763 | ucontrol->value.iec958.status[3] = (chip->uer_bits >> 24) & 0xff; |
764 | up(&chip->mixer_mutex); | 764 | mutex_unlock(&chip->mixer_mutex); |
765 | return 0; | 765 | return 0; |
766 | } | 766 | } |
767 | 767 | ||
@@ -783,14 +783,14 @@ static int vx_iec958_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_valu | |||
783 | (ucontrol->value.iec958.status[1] << 8) | | 783 | (ucontrol->value.iec958.status[1] << 8) | |
784 | (ucontrol->value.iec958.status[2] << 16) | | 784 | (ucontrol->value.iec958.status[2] << 16) | |
785 | (ucontrol->value.iec958.status[3] << 24); | 785 | (ucontrol->value.iec958.status[3] << 24); |
786 | down(&chip->mixer_mutex); | 786 | mutex_lock(&chip->mixer_mutex); |
787 | if (chip->uer_bits != val) { | 787 | if (chip->uer_bits != val) { |
788 | chip->uer_bits = val; | 788 | chip->uer_bits = val; |
789 | vx_set_iec958_status(chip, val); | 789 | vx_set_iec958_status(chip, val); |
790 | up(&chip->mixer_mutex); | 790 | mutex_unlock(&chip->mixer_mutex); |
791 | return 1; | 791 | return 1; |
792 | } | 792 | } |
793 | up(&chip->mixer_mutex); | 793 | mutex_unlock(&chip->mixer_mutex); |
794 | return 0; | 794 | return 0; |
795 | } | 795 | } |
796 | 796 | ||
diff --git a/sound/drivers/vx/vx_pcm.c b/sound/drivers/vx/vx_pcm.c index 464109e421d4..c4af84995d05 100644 --- a/sound/drivers/vx/vx_pcm.c +++ b/sound/drivers/vx/vx_pcm.c | |||
@@ -98,10 +98,9 @@ static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs, size_t s | |||
98 | static int snd_pcm_free_vmalloc_buffer(struct snd_pcm_substream *subs) | 98 | static int snd_pcm_free_vmalloc_buffer(struct snd_pcm_substream *subs) |
99 | { | 99 | { |
100 | struct snd_pcm_runtime *runtime = subs->runtime; | 100 | struct snd_pcm_runtime *runtime = subs->runtime; |
101 | if (runtime->dma_area) { | 101 | |
102 | vfree(runtime->dma_area); | 102 | vfree(runtime->dma_area); |
103 | runtime->dma_area = NULL; | 103 | runtime->dma_area = NULL; |
104 | } | ||
105 | return 0; | 104 | return 0; |
106 | } | 105 | } |
107 | 106 | ||
@@ -1254,9 +1253,13 @@ static int vx_init_audio_io(struct vx_core *chip) | |||
1254 | 1253 | ||
1255 | /* allocate pipes */ | 1254 | /* allocate pipes */ |
1256 | chip->playback_pipes = kmalloc(sizeof(struct vx_pipe *) * chip->audio_outs, GFP_KERNEL); | 1255 | chip->playback_pipes = kmalloc(sizeof(struct vx_pipe *) * chip->audio_outs, GFP_KERNEL); |
1256 | if (!chip->playback_pipes) | ||
1257 | return -ENOMEM; | ||
1257 | chip->capture_pipes = kmalloc(sizeof(struct vx_pipe *) * chip->audio_ins, GFP_KERNEL); | 1258 | chip->capture_pipes = kmalloc(sizeof(struct vx_pipe *) * chip->audio_ins, GFP_KERNEL); |
1258 | if (! chip->playback_pipes || ! chip->capture_pipes) | 1259 | if (!chip->capture_pipes) { |
1260 | kfree(chip->playback_pipes); | ||
1259 | return -ENOMEM; | 1261 | return -ENOMEM; |
1262 | } | ||
1260 | 1263 | ||
1261 | memset(chip->playback_pipes, 0, sizeof(struct vx_pipe *) * chip->audio_outs); | 1264 | memset(chip->playback_pipes, 0, sizeof(struct vx_pipe *) * chip->audio_outs); |
1262 | memset(chip->capture_pipes, 0, sizeof(struct vx_pipe *) * chip->audio_ins); | 1265 | memset(chip->capture_pipes, 0, sizeof(struct vx_pipe *) * chip->audio_ins); |