Blame 0204-arch_init.c-Improve-soundhw-help-for-non-HAS_AUDIO_C.patch

5544c1
From 8daf993d3d75acea92ef5054c924c7d825ae812e Mon Sep 17 00:00:00 2001
5544c1
From: Peter Maydell <peter.maydell@linaro.org>
5544c1
Date: Wed, 19 Sep 2012 14:51:38 +0100
5544c1
Subject: [PATCH] arch_init.c: Improve '-soundhw help' for
5544c1
 non-HAS_AUDIO_CHOICE archs
5544c1
5544c1
For architectures which don't set HAS_AUDIO_CHOICE, improve the
5544c1
'-soundhw help' message so that it doesn't simply print an empty
5544c1
list, implying no sound support at all.
5544c1
5544c1
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5544c1
Signed-off-by: malc <av1474@comtv.ru>
5544c1
(cherry picked from commit 55d4fd3c24bd253bd96270c7fdf1bb862f3a3400)
5544c1
5544c1
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
5544c1
---
5544c1
 arch_init.c | 5 +++++
5544c1
 1 file changed, 5 insertions(+)
5544c1
5544c1
diff --git a/arch_init.c b/arch_init.c
5544c1
index 47977de..f849f9b 100644
5544c1
--- a/arch_init.c
5544c1
+++ b/arch_init.c
5544c1
@@ -922,11 +922,16 @@ void select_soundhw(const char *optarg)
5544c1
     if (is_help_option(optarg)) {
5544c1
     show_valid_cards:
5544c1
 
5544c1
+#ifdef HAS_AUDIO_CHOICE
5544c1
         printf("Valid sound card names (comma separated):\n");
5544c1
         for (c = soundhw; c->name; ++c) {
5544c1
             printf ("%-11s %s\n", c->name, c->descr);
5544c1
         }
5544c1
         printf("\n-soundhw all will enable all of the above\n");
5544c1
+#else
5544c1
+        printf("Machine has no user-selectable audio hardware "
5544c1
+               "(it may or may not have always-present audio hardware).\n");
5544c1
+#endif
5544c1
         exit(!is_help_option(optarg));
5544c1
     }
5544c1
     else {
5544c1
-- 
5544c1
1.7.12.1
5544c1