aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-16 15:50:53 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-16 15:50:53 -0500
commit73d75ba99e3bdd627275afd3fe48cc933723084b (patch)
tree8923aa413662c6eee1f36b473b211aab52474ec2 /sound/core
parent71f777ed50e9109c235c14604d5e23d2f8e7453c (diff)
parentabfe69dd2e313d0c8226ca4a12329e3d829cfd7c (diff)
Merge tag 'sound-fix-3.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "Two peaks in diffstat are for the audio EQ init of IDT codecs and the EMU2004 usb mixer addition, both of which are pretty device-specific, so safe to apply. The rest are a bunch of small fixes, most of them are regression fixes" * tag 'sound-fix-3.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (26 commits) ALSA: hda - load EQ params into IDT codec on HP bNB13 systems ASoC: cs42l52: Correct MIC CTL mask ASoC: wm8962: Turn on regcache_cache_only before disabling regulator ALSA: jack: Unregister input device at disconnection ALSA: pcsp: Fix the order of input device unregistration ASoC: fsl: imx-pcm-fiq: omit fiq counter to avoid harm in unbalanced situations ASoC: blackfin: Fix missing break ALSA: usb-audio: add front jack channel selector for EMU0204 ALSA: hda - Don't clear the power state at snd_hda_codec_reset() ASoC: arizona: Fix typo in name of EQ coefficient controls ALSA: hda - Control EAPD for Master volume on Lenovo N100 ALSA: hda - Don't turn off EAPD for headphone on Lenovo N100 ALSA: isa: not allocating enough space ALSA: snd-aoa: two copy and paste bugs ASoC: wm8997: Correct typo in ISRC mux routes ALSA: hda - Check keep_eapd_on before inv_eapd ALSA: hda - Fix Line Out automute on Realtek multifunction jacks ALSA: msnd: Avoid duplicated driver name ALSA: compress_core: don't return -EBADFD from poll if paused ALSA: hda - hdmi: Fix wrong baseline length in ATI/AMD generated ELD ...
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/compress_offload.c3
-rw-r--r--sound/core/jack.c19
2 files changed, 17 insertions, 5 deletions
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
index d9af6387f37c..9d518ac73eea 100644
--- a/sound/core/compress_offload.c
+++ b/sound/core/compress_offload.c
@@ -384,8 +384,7 @@ static unsigned int snd_compr_poll(struct file *f, poll_table *wait)
384 return -EFAULT; 384 return -EFAULT;
385 385
386 mutex_lock(&stream->device->lock); 386 mutex_lock(&stream->device->lock);
387 if (stream->runtime->state == SNDRV_PCM_STATE_PAUSED || 387 if (stream->runtime->state == SNDRV_PCM_STATE_OPEN) {
388 stream->runtime->state == SNDRV_PCM_STATE_OPEN) {
389 retval = -EBADFD; 388 retval = -EBADFD;
390 goto out; 389 goto out;
391 } 390 }
diff --git a/sound/core/jack.c b/sound/core/jack.c
index b35fe7345c20..8658578eb584 100644
--- a/sound/core/jack.c
+++ b/sound/core/jack.c
@@ -34,12 +34,12 @@ static int jack_switch_types[SND_JACK_SWITCH_TYPES] = {
34 SW_LINEIN_INSERT, 34 SW_LINEIN_INSERT,
35}; 35};
36 36
37static int snd_jack_dev_free(struct snd_device *device) 37static int snd_jack_dev_disconnect(struct snd_device *device)
38{ 38{
39 struct snd_jack *jack = device->device_data; 39 struct snd_jack *jack = device->device_data;
40 40
41 if (jack->private_free) 41 if (!jack->input_dev)
42 jack->private_free(jack); 42 return 0;
43 43
44 /* If the input device is registered with the input subsystem 44 /* If the input device is registered with the input subsystem
45 * then we need to use a different deallocator. */ 45 * then we need to use a different deallocator. */
@@ -47,6 +47,18 @@ static int snd_jack_dev_free(struct snd_device *device)
47 input_unregister_device(jack->input_dev); 47 input_unregister_device(jack->input_dev);
48 else 48 else
49 input_free_device(jack->input_dev); 49 input_free_device(jack->input_dev);
50 jack->input_dev = NULL;
51 return 0;
52}
53
54static int snd_jack_dev_free(struct snd_device *device)
55{
56 struct snd_jack *jack = device->device_data;
57
58 if (jack->private_free)
59 jack->private_free(jack);
60
61 snd_jack_dev_disconnect(device);
50 62
51 kfree(jack->id); 63 kfree(jack->id);
52 kfree(jack); 64 kfree(jack);
@@ -110,6 +122,7 @@ int snd_jack_new(struct snd_card *card, const char *id, int type,
110 static struct snd_device_ops ops = { 122 static struct snd_device_ops ops = {
111 .dev_free = snd_jack_dev_free, 123 .dev_free = snd_jack_dev_free,
112 .dev_register = snd_jack_dev_register, 124 .dev_register = snd_jack_dev_register,
125 .dev_disconnect = snd_jack_dev_disconnect,
113 }; 126 };
114 127
115 jack = kzalloc(sizeof(struct snd_jack), GFP_KERNEL); 128 jack = kzalloc(sizeof(struct snd_jack), GFP_KERNEL);