From f81222bc0cf68464fe82117521917cc1533c3ff4 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 18 Apr 2013 18:44:03 +0200 Subject: audio: look for the ISA and PCI buses Signed-off-by: Paolo Bonzini Message-id: 1366303444-24620-8-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori --- arch_init.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'arch_init.c') diff --git a/arch_init.c b/arch_init.c index 655dfa5d3b..49c5dc27e6 100644 --- a/arch_init.c +++ b/arch_init.c @@ -987,20 +987,26 @@ void select_soundhw(const char *optarg) } } -void audio_init(ISABus *isa_bus, PCIBus *pci_bus) +void audio_init(void) { struct soundhw *c; + ISABus *isa_bus = (ISABus *) object_resolve_path_type("", TYPE_ISA_BUS, NULL); + PCIBus *pci_bus = (PCIBus *) object_resolve_path_type("", TYPE_PCI_BUS, NULL); for (c = soundhw; c->name; ++c) { if (c->enabled) { if (c->isa) { - if (isa_bus) { - c->init.init_isa(isa_bus); + if (!isa_bus) { + fprintf(stderr, "ISA bus not available for %s\n", c->name); + exit(1); } + c->init.init_isa(isa_bus); } else { - if (pci_bus) { - c->init.init_pci(pci_bus); + if (!pci_bus) { + fprintf(stderr, "PCI bus not available for %s\n", c->name); + exit(1); } + c->init.init_pci(pci_bus); } } } -- cgit v1.2.1