Skip to content

Commit 6f54c36

Browse files
committed
ALSA: hda/hdmi - Work around "alsactl restore" errors
When "alsactl restore" is performed on HDMI codecs, it tries to restore the channel map value since the channel map controls are writable. But hdmi_chmap_ctl_put() returns -EBADFD when no PCM stream is assigned yet, and this results in an error message from alsactl. Although the error is harmless, it's certainly ugly and can be regarded as a regression. As a workaround, this patch changes the return code in such a case to be zero for making others happy. (A slight excuse is: when the chmap is changed through the proper alsa-lib API, the PCM status is checked there anyway, so we don't have to be too strict in the kernel side.) Cc: <stable@vger.kernel.org> [v3.7+] Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 2e4c4db commit 6f54c36

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/pci/hda/patch_hdmi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1502,7 +1502,7 @@ static int hdmi_chmap_ctl_put(struct snd_kcontrol *kcontrol,
15021502
ctl_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
15031503
substream = snd_pcm_chmap_substream(info, ctl_idx);
15041504
if (!substream || !substream->runtime)
1505-
return -EBADFD;
1505+
return 0; /* just for avoiding error from alsactl restore */
15061506
switch (substream->runtime->status->state) {
15071507
case SNDRV_PCM_STATE_OPEN:
15081508
case SNDRV_PCM_STATE_SETUP:

0 commit comments

Comments
 (0)