aboutsummaryrefslogtreecommitdiff
path: root/arch_init.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2013-04-18 18:44:03 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2013-04-29 12:16:57 -0500
commitf81222bc0cf68464fe82117521917cc1533c3ff4 (patch)
tree9c23c1c62ce41a647ab30da7786686a2fe61ece9 /arch_init.c
parent2e1103f60a871923ecd390804aba07b6031e0dc0 (diff)
audio: look for the ISA and PCI buses
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1366303444-24620-8-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'arch_init.c')
-rw-r--r--arch_init.c16
1 files changed, 11 insertions, 5 deletions
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);
}
}
}