aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/oss
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /sound/core/oss
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'sound/core/oss')
-rw-r--r--sound/core/oss/mixer_oss.c16
-rw-r--r--sound/core/oss/pcm_oss.c11
-rw-r--r--sound/core/oss/pcm_plugin.c6
3 files changed, 7 insertions, 26 deletions
diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c
index e8a1d18774b..d8359cfeca1 100644
--- a/sound/core/oss/mixer_oss.c
+++ b/sound/core/oss/mixer_oss.c
@@ -23,7 +23,6 @@
23#include <linux/slab.h> 23#include <linux/slab.h>
24#include <linux/time.h> 24#include <linux/time.h>
25#include <linux/string.h> 25#include <linux/string.h>
26#include <linux/module.h>
27#include <sound/core.h> 26#include <sound/core.h>
28#include <sound/minors.h> 27#include <sound/minors.h>
29#include <sound/control.h> 28#include <sound/control.h>
@@ -52,19 +51,14 @@ static int snd_mixer_oss_open(struct inode *inode, struct file *file)
52 SNDRV_OSS_DEVICE_TYPE_MIXER); 51 SNDRV_OSS_DEVICE_TYPE_MIXER);
53 if (card == NULL) 52 if (card == NULL)
54 return -ENODEV; 53 return -ENODEV;
55 if (card->mixer_oss == NULL) { 54 if (card->mixer_oss == NULL)
56 snd_card_unref(card);
57 return -ENODEV; 55 return -ENODEV;
58 }
59 err = snd_card_file_add(card, file); 56 err = snd_card_file_add(card, file);
60 if (err < 0) { 57 if (err < 0)
61 snd_card_unref(card);
62 return err; 58 return err;
63 }
64 fmixer = kzalloc(sizeof(*fmixer), GFP_KERNEL); 59 fmixer = kzalloc(sizeof(*fmixer), GFP_KERNEL);
65 if (fmixer == NULL) { 60 if (fmixer == NULL) {
66 snd_card_file_remove(card, file); 61 snd_card_file_remove(card, file);
67 snd_card_unref(card);
68 return -ENOMEM; 62 return -ENOMEM;
69 } 63 }
70 fmixer->card = card; 64 fmixer->card = card;
@@ -73,10 +67,8 @@ static int snd_mixer_oss_open(struct inode *inode, struct file *file)
73 if (!try_module_get(card->module)) { 67 if (!try_module_get(card->module)) {
74 kfree(fmixer); 68 kfree(fmixer);
75 snd_card_file_remove(card, file); 69 snd_card_file_remove(card, file);
76 snd_card_unref(card);
77 return -EFAULT; 70 return -EFAULT;
78 } 71 }
79 snd_card_unref(card);
80 return 0; 72 return 0;
81} 73}
82 74
@@ -507,7 +499,7 @@ static struct snd_kcontrol *snd_mixer_oss_test_id(struct snd_mixer_oss *mixer, c
507 499
508 memset(&id, 0, sizeof(id)); 500 memset(&id, 0, sizeof(id));
509 id.iface = SNDRV_CTL_ELEM_IFACE_MIXER; 501 id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
510 strlcpy(id.name, name, sizeof(id.name)); 502 strcpy(id.name, name);
511 id.index = index; 503 id.index = index;
512 return snd_ctl_find_id(card, &id); 504 return snd_ctl_find_id(card, &id);
513} 505}
@@ -1053,7 +1045,6 @@ static int snd_mixer_oss_build_input(struct snd_mixer_oss *mixer, struct snd_mix
1053 1045
1054 if (kctl->info(kctl, uinfo)) { 1046 if (kctl->info(kctl, uinfo)) {
1055 up_read(&mixer->card->controls_rwsem); 1047 up_read(&mixer->card->controls_rwsem);
1056 kfree(uinfo);
1057 return 0; 1048 return 0;
1058 } 1049 }
1059 strcpy(str, ptr->name); 1050 strcpy(str, ptr->name);
@@ -1069,7 +1060,6 @@ static int snd_mixer_oss_build_input(struct snd_mixer_oss *mixer, struct snd_mix
1069 uinfo->value.enumerated.item = slot.capture_item; 1060 uinfo->value.enumerated.item = slot.capture_item;
1070 if (kctl->info(kctl, uinfo)) { 1061 if (kctl->info(kctl, uinfo)) {
1071 up_read(&mixer->card->controls_rwsem); 1062 up_read(&mixer->card->controls_rwsem);
1072 kfree(uinfo);
1073 return 0; 1063 return 0;
1074 } 1064 }
1075 if (!strcmp(uinfo->value.enumerated.name, str)) { 1065 if (!strcmp(uinfo->value.enumerated.name, str)) {
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index 4c1cc51772e..23c34a02894 100644
--- a/sound/core/oss/pcm_oss.c
+++ b/sound/core/oss/pcm_oss.c
@@ -30,7 +30,7 @@
30#include <linux/slab.h> 30#include <linux/slab.h>
31#include <linux/time.h> 31#include <linux/time.h>
32#include <linux/vmalloc.h> 32#include <linux/vmalloc.h>
33#include <linux/module.h> 33#include <linux/moduleparam.h>
34#include <linux/math64.h> 34#include <linux/math64.h>
35#include <linux/string.h> 35#include <linux/string.h>
36#include <sound/core.h> 36#include <sound/core.h>
@@ -47,7 +47,7 @@
47 47
48static int dsp_map[SNDRV_CARDS]; 48static int dsp_map[SNDRV_CARDS];
49static int adsp_map[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 1}; 49static int adsp_map[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 1};
50static bool nonblock_open = 1; 50static int nonblock_open = 1;
51 51
52MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>, Abramo Bagnara <abramo@alsa-project.org>"); 52MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>, Abramo Bagnara <abramo@alsa-project.org>");
53MODULE_DESCRIPTION("PCM OSS emulation for ALSA."); 53MODULE_DESCRIPTION("PCM OSS emulation for ALSA.");
@@ -2441,10 +2441,6 @@ static int snd_pcm_oss_open(struct inode *inode, struct file *file)
2441 mutex_unlock(&pcm->open_mutex); 2441 mutex_unlock(&pcm->open_mutex);
2442 schedule(); 2442 schedule();
2443 mutex_lock(&pcm->open_mutex); 2443 mutex_lock(&pcm->open_mutex);
2444 if (pcm->card->shutdown) {
2445 err = -ENODEV;
2446 break;
2447 }
2448 if (signal_pending(current)) { 2444 if (signal_pending(current)) {
2449 err = -ERESTARTSYS; 2445 err = -ERESTARTSYS;
2450 break; 2446 break;
@@ -2454,7 +2450,6 @@ static int snd_pcm_oss_open(struct inode *inode, struct file *file)
2454 mutex_unlock(&pcm->open_mutex); 2450 mutex_unlock(&pcm->open_mutex);
2455 if (err < 0) 2451 if (err < 0)
2456 goto __error; 2452 goto __error;
2457 snd_card_unref(pcm->card);
2458 return err; 2453 return err;
2459 2454
2460 __error: 2455 __error:
@@ -2462,8 +2457,6 @@ static int snd_pcm_oss_open(struct inode *inode, struct file *file)
2462 __error2: 2457 __error2:
2463 snd_card_file_remove(pcm->card, file); 2458 snd_card_file_remove(pcm->card, file);
2464 __error1: 2459 __error1:
2465 if (pcm)
2466 snd_card_unref(pcm->card);
2467 return err; 2460 return err;
2468} 2461}
2469 2462
diff --git a/sound/core/oss/pcm_plugin.c b/sound/core/oss/pcm_plugin.c
index 727ac44d39f..71cc3ddf5c1 100644
--- a/sound/core/oss/pcm_plugin.c
+++ b/sound/core/oss/pcm_plugin.c
@@ -199,13 +199,12 @@ int snd_pcm_plugin_free(struct snd_pcm_plugin *plugin)
199snd_pcm_sframes_t snd_pcm_plug_client_size(struct snd_pcm_substream *plug, snd_pcm_uframes_t drv_frames) 199snd_pcm_sframes_t snd_pcm_plug_client_size(struct snd_pcm_substream *plug, snd_pcm_uframes_t drv_frames)
200{ 200{
201 struct snd_pcm_plugin *plugin, *plugin_prev, *plugin_next; 201 struct snd_pcm_plugin *plugin, *plugin_prev, *plugin_next;
202 int stream; 202 int stream = snd_pcm_plug_stream(plug);
203 203
204 if (snd_BUG_ON(!plug)) 204 if (snd_BUG_ON(!plug))
205 return -ENXIO; 205 return -ENXIO;
206 if (drv_frames == 0) 206 if (drv_frames == 0)
207 return 0; 207 return 0;
208 stream = snd_pcm_plug_stream(plug);
209 if (stream == SNDRV_PCM_STREAM_PLAYBACK) { 208 if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
210 plugin = snd_pcm_plug_last(plug); 209 plugin = snd_pcm_plug_last(plug);
211 while (plugin && drv_frames > 0) { 210 while (plugin && drv_frames > 0) {
@@ -231,14 +230,13 @@ snd_pcm_sframes_t snd_pcm_plug_slave_size(struct snd_pcm_substream *plug, snd_pc
231{ 230{
232 struct snd_pcm_plugin *plugin, *plugin_prev, *plugin_next; 231 struct snd_pcm_plugin *plugin, *plugin_prev, *plugin_next;
233 snd_pcm_sframes_t frames; 232 snd_pcm_sframes_t frames;
234 int stream; 233 int stream = snd_pcm_plug_stream(plug);
235 234
236 if (snd_BUG_ON(!plug)) 235 if (snd_BUG_ON(!plug))
237 return -ENXIO; 236 return -ENXIO;
238 if (clt_frames == 0) 237 if (clt_frames == 0)
239 return 0; 238 return 0;
240 frames = clt_frames; 239 frames = clt_frames;
241 stream = snd_pcm_plug_stream(plug);
242 if (stream == SNDRV_PCM_STREAM_PLAYBACK) { 240 if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
243 plugin = snd_pcm_plug_first(plug); 241 plugin = snd_pcm_plug_first(plug);
244 while (plugin && frames > 0) { 242 while (plugin && frames > 0) {