diff options
author | Martin Kletzander <mkletzan@redhat.com> | 2023-10-02 16:27:57 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2023-10-03 10:29:40 +0200 |
commit | cb94ff5f80c537e43c04fa4f071f1df784255310 (patch) | |
tree | 18907d34d44c8e344ea2174c5bd80e6fa8dc5169 /hw/audio/sb16.c | |
parent | 9dcb64c96073e9898105cdbef6553cfef0fadcdb (diff) | |
download | qemu-cb94ff5f80c537e43c04fa4f071f1df784255310.zip qemu-cb94ff5f80c537e43c04fa4f071f1df784255310.tar.gz qemu-cb94ff5f80c537e43c04fa4f071f1df784255310.tar.bz2 |
audio: propagate Error * out of audio_init
Starting from audio_driver_init, propagate errors via Error ** so that
audio_init_audiodevs can simply pass &error_fatal, and AUD_register_card
can signal faiure.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
[Reworked the audio/audio.c parts, while keeping Martin's hw/ changes. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/audio/sb16.c')
-rw-r--r-- | hw/audio/sb16.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c index 535cccc..18f6d25 100644 --- a/hw/audio/sb16.c +++ b/hw/audio/sb16.c @@ -1402,6 +1402,10 @@ static void sb16_realizefn (DeviceState *dev, Error **errp) SB16State *s = SB16 (dev); IsaDmaClass *k; + if (!AUD_register_card ("sb16", &s->card, errp)) { + return; + } + s->isa_hdma = isa_bus_get_dma(bus, s->hdma); s->isa_dma = isa_bus_get_dma(bus, s->dma); if (!s->isa_dma || !s->isa_hdma) { @@ -1434,8 +1438,6 @@ static void sb16_realizefn (DeviceState *dev, Error **errp) k->register_channel(s->isa_dma, s->dma, SB_read_DMA, s); s->can_write = 1; - - AUD_register_card ("sb16", &s->card); } static Property sb16_properties[] = { |