From 1b004d03d8670bdd871e0f297ed20bc510e404de Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Sat, 20 Aug 2011 09:19:59 +0200
Subject: [PATCH] ALSA: hda - Fix error check from snd_hda_get_conn_index() in patch_cirrus.c
Git-commit: 1b004d03d8670bdd871e0f297ed20bc510e404de
Patch-mainline: 3.1-rc3
References: FATE#313695

snd_hda_get_conn_index() returns a negative value while the current code
stores it in an unsigned int.  It must be stored in a signed integer.

Reported-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

---
 sound/pci/hda/patch_cirrus.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/sound/pci/hda/patch_cirrus.c
+++ b/sound/pci/hda/patch_cirrus.c
@@ -341,7 +341,7 @@ static int is_ext_mic(struct hda_codec *
 static hda_nid_t get_adc(struct hda_codec *codec, hda_nid_t pin,
 			 unsigned int *idxp)
 {
-	int i;
+	int i, idx;
 	hda_nid_t nid;
 
 	nid = codec->start_nid;
@@ -351,7 +351,7 @@ static hda_nid_t get_adc(struct hda_code
 		type = get_wcaps_type(get_wcaps(codec, nid));
 		if (type != AC_WID_AUD_IN)
 			continue;
-		idx = snd_hda_get_conn_index(codec, nid, pin, 0);
+		idx = snd_hda_get_conn_index(codec, nid, pin, false);
 		if (idx >= 0) {
 			*idxp = idx;
 			return nid;
