diff options
author | Paul Brook <paul@codesourcery.com> | 2009-05-12 12:02:38 +0100 |
---|---|---|
committer | Paul Brook <paul@codesourcery.com> | 2009-05-12 12:02:38 +0100 |
commit | 0d9acba8fddbf970c7353083e6a60b47017ce3e4 (patch) | |
tree | d4b709ce317ced6e21ea29378d00a0b5dd6c6bf6 /hw | |
parent | f0f26a06d51b7e7764f8951cdbf67ac9ad507f6d (diff) |
Make AUD_init failure fatal
Failure to initialize the audio subsystem is not handled consistently.
Where it is handled it has guest visible effects, which is wrong.
We already have a "nosound" audio driver as a last resort, so trying to
proceed without an audio backend seems pointless.
Also protect against multiple calls to AUD_init so that this can be
pushed down into individual devices.
Signed-off-by: Paul Brook <paul@codesourcery.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/mips_jazz.c | 10 | ||||
-rw-r--r-- | hw/mips_malta.c | 7 | ||||
-rw-r--r-- | hw/musicpal.c | 4 | ||||
-rw-r--r-- | hw/pc.c | 18 | ||||
-rw-r--r-- | hw/spitz.c | 2 |
5 files changed, 15 insertions, 26 deletions
diff --git a/hw/mips_jazz.c b/hw/mips_jazz.c index 955041336b..3734aa918e 100644 --- a/hw/mips_jazz.c +++ b/hw/mips_jazz.c @@ -107,12 +107,10 @@ static void audio_init(qemu_irq *pic) AudioState *s; s = AUD_init(); - if (s) { - for (c = soundhw; c->name; ++c) { - if (c->enabled) { - if (c->isa) { - c->init.init_isa(s, pic); - } + for (c = soundhw; c->name; ++c) { + if (c->enabled) { + if (c->isa) { + c->init.init_isa(s, pic); } } } diff --git a/hw/mips_malta.c b/hw/mips_malta.c index e7504c1bf5..015c16bcf4 100644 --- a/hw/mips_malta.c +++ b/hw/mips_malta.c @@ -472,10 +472,9 @@ static void audio_init (PCIBus *pci_bus) AudioState *s; s = AUD_init (); - if (s) { - for (c = soundhw; c->name; ++c) { - if (c->enabled) - c->init.init_pci (pci_bus, s); + for (c = soundhw; c->name; ++c) { + if (c->enabled) { + c->init.init_pci (pci_bus, s); } } } diff --git a/hw/musicpal.c b/hw/musicpal.c index b698610b90..0c47e5d80d 100644 --- a/hw/musicpal.c +++ b/hw/musicpal.c @@ -428,10 +428,6 @@ static i2c_interface *musicpal_audio_init(qemu_irq irq) int iomemtype; audio = AUD_init(); - if (!audio) { - AUD_log(audio_name, "No audio state\n"); - return NULL; - } s = qemu_mallocz(sizeof(musicpal_audio_state)); s->irq = irq; @@ -791,16 +791,14 @@ static void audio_init (PCIBus *pci_bus, qemu_irq *pic) AudioState *s; s = AUD_init (); - if (s) { - for (c = soundhw; c->name; ++c) { - if (c->enabled) { - if (c->isa) { - c->init.init_isa (s, pic); - } - else { - if (pci_bus) { - c->init.init_pci (pci_bus, s); - } + for (c = soundhw; c->name; ++c) { + if (c->enabled) { + if (c->isa) { + c->init.init_isa (s, pic); + } + else { + if (pci_bus) { + c->init.init_pci (pci_bus, s); } } } diff --git a/hw/spitz.c b/hw/spitz.c index 3c155a4b35..e53a81da6d 100644 --- a/hw/spitz.c +++ b/hw/spitz.c @@ -744,8 +744,6 @@ static void spitz_i2c_setup(PXA2xxState *cpu) i2c_slave *wm; audio = AUD_init(); - if (!audio) - return; /* Attach a WM8750 to the bus */ wm = wm8750_init(bus, audio); |