summaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-16 12:50:53 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-16 12:50:53 -0800
commit73d75ba99e3bdd627275afd3fe48cc933723084b (patch)
tree8923aa413662c6eee1f36b473b211aab52474ec2 /sound/core
parent71f777ed50e9109c235c14604d5e23d2f8e7453c (diff)
parentabfe69dd2e313d0c8226ca4a12329e3d829cfd7c (diff)
downloadblackbird-op-linux-73d75ba99e3bdd627275afd3fe48cc933723084b.tar.gz
blackbird-op-linux-73d75ba99e3bdd627275afd3fe48cc933723084b.zip
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)
return -EFAULT;
mutex_lock(&stream->device->lock);
- if (stream->runtime->state == SNDRV_PCM_STATE_PAUSED ||
- stream->runtime->state == SNDRV_PCM_STATE_OPEN) {
+ if (stream->runtime->state == SNDRV_PCM_STATE_OPEN) {
retval = -EBADFD;
goto out;
}
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] = {
SW_LINEIN_INSERT,
};
-static int snd_jack_dev_free(struct snd_device *device)
+static int snd_jack_dev_disconnect(struct snd_device *device)
{
struct snd_jack *jack = device->device_data;
- if (jack->private_free)
- jack->private_free(jack);
+ if (!jack->input_dev)
+ return 0;
/* If the input device is registered with the input subsystem
* then we need to use a different deallocator. */
@@ -47,6 +47,18 @@ static int snd_jack_dev_free(struct snd_device *device)
input_unregister_device(jack->input_dev);
else
input_free_device(jack->input_dev);
+ jack->input_dev = NULL;
+ return 0;
+}
+
+static int snd_jack_dev_free(struct snd_device *device)
+{
+ struct snd_jack *jack = device->device_data;
+
+ if (jack->private_free)
+ jack->private_free(jack);
+
+ snd_jack_dev_disconnect(device);
kfree(jack->id);
kfree(jack);
@@ -110,6 +122,7 @@ int snd_jack_new(struct snd_card *card, const char *id, int type,
static struct snd_device_ops ops = {
.dev_free = snd_jack_dev_free,
.dev_register = snd_jack_dev_register,
+ .dev_disconnect = snd_jack_dev_disconnect,
};
jack = kzalloc(sizeof(struct snd_jack), GFP_KERNEL);
OpenPOWER on IntegriCloud