summaryrefslogtreecommitdiff
path: root/sound/x86
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2017-01-30 17:31:29 +0100
committerTakashi Iwai <tiwai@suse.de>2017-02-03 17:23:04 +0100
commitdd895f2e9b013a5387372dbf3a7d8405aaeb494e (patch)
tree818460fd88861e6cdd10d9d7647ec7221227ff91 /sound/x86
parent45459d16867988a792a18233bdfc294492976841 (diff)
ALSA: x86: Drop useless mutex at probe
had_mutex is (supposedly) used to protect the concurrent calls of hdmi_audio_probe(). But we may have only one device at most, so it's utterly useless. Drop it. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/x86')
-rw-r--r--sound/x86/intel_hdmi_audio.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c
index 45ba16e27323..7165f14d5229 100644
--- a/sound/x86/intel_hdmi_audio.c
+++ b/sound/x86/intel_hdmi_audio.c
@@ -37,8 +37,6 @@
#include <sound/initval.h>
#include "intel_hdmi_audio.h"
-static DEFINE_MUTEX(had_mutex);
-
/*standard module options for ALSA. This module supports only one card*/
static int hdmi_card_index = SNDRV_DEFAULT_IDX1;
static char *hdmi_card_id = SNDRV_DEFAULT_STR1;
@@ -1621,7 +1619,7 @@ int hdmi_audio_probe(struct platform_device *devptr,
pr_err("querying display driver APIs failed %#x\n", retval);
goto free_hadstream;
}
- mutex_lock(&had_mutex);
+
spin_lock_init(&intelhaddata->had_spinlock);
intelhaddata->drv_status = HAD_DRV_DISCONNECTED;
pr_debug("%s @ %d:DEBUG PLUG/UNPLUG : HAD_DRV_DISCONNECTED\n",
@@ -1632,7 +1630,7 @@ int hdmi_audio_probe(struct platform_device *devptr,
THIS_MODULE, 0, &card);
if (retval)
- goto unlock_mutex;
+ goto free_hadstream;
intelhaddata->card = card;
intelhaddata->card_id = hdmi_card_id;
intelhaddata->card_index = card->number;
@@ -1705,16 +1703,12 @@ int hdmi_audio_probe(struct platform_device *devptr,
pm_runtime_set_active(intelhaddata->dev);
pm_runtime_enable(intelhaddata->dev);
- mutex_unlock(&had_mutex);
-
intelhaddata->hw_silence = 1;
*had_ret = intelhaddata;
return 0;
err:
snd_card_free(card);
-unlock_mutex:
- mutex_unlock(&had_mutex);
free_hadstream:
kfree(had_stream);
pm_runtime_disable(intelhaddata->dev);