All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: hda - Make path_has_mixer() tristate
@ 2015-03-03 11:20 Ingo Brückl
  2015-03-04 11:48 ` Takashi Iwai
  2015-03-04 14:08 ` Raymond Yau
  0 siblings, 2 replies; 15+ messages in thread
From: Ingo Brückl @ 2015-03-03 11:20 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, superquad.vortex2, david.henningsson

... in order to distinguish whether there is no ctl or no path at all.

It is used as !path_has_mixer() which means that it is true even if
there is no path at all. For headphone or speaker outs without path,
because they don't have a DAC assign to them, this would give a false
positive result.

Signed-off-by: Ingo Brückl <ib@wupperonline.de>

diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index b680b4e..ecee349 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -1035,11 +1035,11 @@ static int hda_gen_bind_mute_put(struct snd_kcontrol *kcontrol,
 	return snd_hda_mixer_bind_switch_put(kcontrol, ucontrol);
 }

-/* any ctl assigned to the path with the given index? */
-static bool path_has_mixer(struct hda_codec *codec, int path_idx, int ctl_type)
+/* any ctl assigned to the path (if one at all) with the given index? */
+static int path_has_mixer(struct hda_codec *codec, int path_idx, int ctl_type)
 {
 	struct nid_path *path = snd_hda_get_path_from_idx(codec, path_idx);
-	return path && path->ctls[ctl_type];
+	return path ? path->ctls[ctl_type] : -1;
 }

 static const char * const channel_name[4] = {
--
1.7.10

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2015-03-06 13:13 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-03 11:20 [PATCH] ALSA: hda - Make path_has_mixer() tristate Ingo Brückl
2015-03-04 11:48 ` Takashi Iwai
2015-03-05 10:20   ` Ingo Brückl
2015-03-05 11:38     ` Takashi Iwai
2015-03-05 16:44       ` Ingo Brückl
2015-03-06  9:38         ` Takashi Iwai
2015-03-06  9:57           ` Ingo Brückl
2015-03-06 10:20             ` David Henningsson
2015-03-06 10:45               ` Ingo Brückl
2015-03-06 10:54               ` Takashi Iwai
2015-03-06 11:07                 ` Ingo Brückl
2015-03-06 11:33                   ` Takashi Iwai
2015-03-06 12:33                     ` Ingo Brückl
2015-03-06 13:13                       ` Takashi Iwai
2015-03-04 14:08 ` Raymond Yau

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.