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/hda-codec.c | |
| parent | 9dcb64c96073e9898105cdbef6553cfef0fadcdb (diff) | |
| download | focaccia-qemu-cb94ff5f80c537e43c04fa4f071f1df784255310.tar.gz focaccia-qemu-cb94ff5f80c537e43c04fa4f071f1df784255310.zip | |
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/hda-codec.c')
| -rw-r--r-- | hw/audio/hda-codec.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c index a26048cf15..b9ad1f4c39 100644 --- a/hw/audio/hda-codec.c +++ b/hw/audio/hda-codec.c @@ -685,11 +685,14 @@ static void hda_audio_init(HDACodecDevice *hda, const desc_param *param; uint32_t i, type; + if (!AUD_register_card("hda", &a->card, errp)) { + return; + } + a->desc = desc; a->name = object_get_typename(OBJECT(a)); dprint(a, 1, "%s: cad %d\n", __func__, a->hda.cad); - AUD_register_card("hda", &a->card); for (i = 0; i < a->desc->nnodes; i++) { node = a->desc->nodes + i; param = hda_codec_find_param(node, AC_PAR_AUDIO_WIDGET_CAP); |