diff mbox

[3/5] hda-emu: Improve error message for modem codecs

Message ID 1409833267-9778-4-git-send-email-david.henningsson@canonical.com (mailing list archive)
State Accepted
Delegated to: Takashi Iwai
Headers show

Commit Message

David Henningsson Sept. 4, 2014, 12:21 p.m. UTC
In some cases (when codec index parameter was specified),
selecting a modem codec resulted in "ERROR -77", which was
confusing.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
---
 hda-parse.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/hda-parse.c b/hda-parse.c
index 57e9ee3..b5abd5e 100644
--- a/hda-parse.c
+++ b/hda-parse.c
@@ -675,13 +675,17 @@  int parse_codec_proc(FILE *fp, struct xhda_codec *codecp, int codec_index)
 			parse_mode = PARSE_ROOT;
 		}
 		err = parse_codec_recursive(buffer);
-		if (err < 0) {
-			if (err == -EBADFD && codec_index < 0) {
+		if (err == -EBADFD) {
+			if (codec_index < 0) {
 				hda_log(HDA_LOG_INFO, "Codec %d is a modem codec, skipping\n", curidx);
 				parse_mode = PARSE_START;
 				clear_codec(codec);
 				continue;
 			}
+			hda_log(HDA_LOG_ERR, "Codec %d is a modem codec, aborting\n", curidx);
+			return err;
+		}
+		else if (err < 0) {
 			hda_log(HDA_LOG_ERR, "ERROR %d\n", err);
 			return err;
 		}