From ca89f72092bdb42e077f2f64f417edad009ce0ef Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Mon, 8 May 2017 17:57:33 -0300 Subject: audio: Move arch_init audio code to hw/audio/soundhw.c There's no reason to keep the soundhw table in arch_init.c. Move that code to a new hw/audio/soundhw.c file. While moving the code, trivial coding style issues were fixed. Signed-off-by: Eduardo Habkost Reviewed-by: David Gibson Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Message-id: 20170508205735.23444-2-ehabkost@redhat.com Signed-off-by: Gerd Hoffmann --- include/hw/audio/audio.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/hw') diff --git a/include/hw/audio/audio.h b/include/hw/audio/audio.h index 55d40f71bf..259bb2cf96 100644 --- a/include/hw/audio/audio.h +++ b/include/hw/audio/audio.h @@ -7,4 +7,7 @@ void isa_register_soundhw(const char *name, const char *descr, void pci_register_soundhw(const char *name, const char *descr, int (*init_pci)(PCIBus *bus)); +void audio_init(void); +void select_soundhw(const char *optarg); + #endif -- cgit v1.2.3-55-g7522 From 4c565674a2af027fba977bea8ab1bdf440d0cf63 Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Mon, 8 May 2017 17:57:34 -0300 Subject: audio: Rename audio_init() to soundhw_init() To make it consistent with the remaining soundhw.c functions and avoid confusion with the audio_init() function in audio/audio.c, rename audio_init() to soundhw_init(). Signed-off-by: Eduardo Habkost Reviewed-by: David Gibson Message-id: 20170508205735.23444-3-ehabkost@redhat.com Signed-off-by: Gerd Hoffmann --- hw/audio/soundhw.c | 2 +- hw/ppc/prep.c | 2 +- include/hw/audio/audio.h | 2 +- vl.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'include/hw') diff --git a/hw/audio/soundhw.c b/hw/audio/soundhw.c index 5e96b73c81..29565da93d 100644 --- a/hw/audio/soundhw.c +++ b/hw/audio/soundhw.c @@ -129,7 +129,7 @@ void select_soundhw(const char *optarg) } } -void audio_init(void) +void soundhw_init(void) { struct soundhw *c; ISABus *isa_bus = (ISABus *) object_resolve_path_type("", TYPE_ISA_BUS, NULL); diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index 96a4813b3f..4a7d2cfbe0 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -783,7 +783,7 @@ static void ibm_40p_init(MachineState *machine) &cmos_checksum); /* initialize audio subsystem */ - audio_init(); + soundhw_init(); /* add some more devices */ if (defaults_enabled()) { diff --git a/include/hw/audio/audio.h b/include/hw/audio/audio.h index 259bb2cf96..119f7d78d5 100644 --- a/include/hw/audio/audio.h +++ b/include/hw/audio/audio.h @@ -7,7 +7,7 @@ void isa_register_soundhw(const char *name, const char *descr, void pci_register_soundhw(const char *name, const char *descr, int (*init_pci)(PCIBus *bus)); -void audio_init(void); +void soundhw_init(void); void select_soundhw(const char *optarg); #endif diff --git a/vl.c b/vl.c index 6e46889cde..8f08f422a7 100644 --- a/vl.c +++ b/vl.c @@ -4575,7 +4575,7 @@ int main(int argc, char **argv, char **envp) realtime_init(); - audio_init(); + soundhw_init(); if (hax_enabled()) { hax_sync_vcpus(); -- cgit v1.2.3-55-g7522 From 8a824e4d74213a2da39323304f949c5b4243e1fb Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Mon, 8 May 2017 17:57:35 -0300 Subject: audio: Rename hw/audio/audio.h to hw/audio/soundhw.h All the functions in hw/audio/audio.h are called "soundhw_*()" and live in hw/audio/audiohw.c. Rename the header file for consistency. Signed-off-by: Eduardo Habkost Reviewed-by: David Gibson Reviewed-by: Hervé Poussineau Message-id: 20170508205735.23444-4-ehabkost@redhat.com Signed-off-by: Gerd Hoffmann --- arch_init.c | 2 +- hw/audio/ac97.c | 2 +- hw/audio/adlib.c | 2 +- hw/audio/cs4231a.c | 2 +- hw/audio/es1370.c | 2 +- hw/audio/gus.c | 2 +- hw/audio/intel-hda.c | 2 +- hw/audio/pcspk.c | 2 +- hw/audio/sb16.c | 2 +- hw/audio/soundhw.c | 2 +- hw/ppc/prep.c | 2 +- include/hw/audio/audio.h | 13 ------------- include/hw/audio/soundhw.h | 13 +++++++++++++ vl.c | 2 +- 14 files changed, 25 insertions(+), 25 deletions(-) delete mode 100644 include/hw/audio/audio.h create mode 100644 include/hw/audio/soundhw.h (limited to 'include/hw') diff --git a/arch_init.c b/arch_init.c index 74ca62f508..a0b8ed6167 100644 --- a/arch_init.c +++ b/arch_init.c @@ -27,7 +27,7 @@ #include "sysemu/sysemu.h" #include "sysemu/arch_init.h" #include "hw/pci/pci.h" -#include "hw/audio/audio.h" +#include "hw/audio/soundhw.h" #include "qemu/config-file.h" #include "qemu/error-report.h" #include "qmp-commands.h" diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c index c30657501c..959c786261 100644 --- a/hw/audio/ac97.c +++ b/hw/audio/ac97.c @@ -19,7 +19,7 @@ #include "qemu/osdep.h" #include "hw/hw.h" -#include "hw/audio/audio.h" +#include "hw/audio/soundhw.h" #include "audio/audio.h" #include "hw/pci/pci.h" #include "sysemu/dma.h" diff --git a/hw/audio/adlib.c b/hw/audio/adlib.c index 09b8248cda..c6e0f10c16 100644 --- a/hw/audio/adlib.c +++ b/hw/audio/adlib.c @@ -25,7 +25,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "hw/hw.h" -#include "hw/audio/audio.h" +#include "hw/audio/soundhw.h" #include "audio/audio.h" #include "hw/isa/isa.h" diff --git a/hw/audio/cs4231a.c b/hw/audio/cs4231a.c index 3ecd0582bf..096e8e98d7 100644 --- a/hw/audio/cs4231a.c +++ b/hw/audio/cs4231a.c @@ -23,7 +23,7 @@ */ #include "qemu/osdep.h" #include "hw/hw.h" -#include "hw/audio/audio.h" +#include "hw/audio/soundhw.h" #include "audio/audio.h" #include "hw/isa/isa.h" #include "hw/qdev.h" diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c index fe64c1ac37..dd7c23d185 100644 --- a/hw/audio/es1370.c +++ b/hw/audio/es1370.c @@ -28,7 +28,7 @@ #include "qemu/osdep.h" #include "hw/hw.h" -#include "hw/audio/audio.h" +#include "hw/audio/soundhw.h" #include "audio/audio.h" #include "hw/pci/pci.h" #include "sysemu/dma.h" diff --git a/hw/audio/gus.c b/hw/audio/gus.c index ec103a4db9..3e864cd36d 100644 --- a/hw/audio/gus.c +++ b/hw/audio/gus.c @@ -24,7 +24,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "hw/hw.h" -#include "hw/audio/audio.h" +#include "hw/audio/soundhw.h" #include "audio/audio.h" #include "hw/isa/isa.h" #include "gusemu.h" diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index 2c497eb174..06acc98f7b 100644 --- a/hw/audio/intel-hda.c +++ b/hw/audio/intel-hda.c @@ -22,7 +22,7 @@ #include "hw/pci/pci.h" #include "hw/pci/msi.h" #include "qemu/timer.h" -#include "hw/audio/audio.h" +#include "hw/audio/soundhw.h" #include "intel-hda.h" #include "intel-hda-defs.h" #include "sysemu/dma.h" diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c index 9b99358d87..f643b122bb 100644 --- a/hw/audio/pcspk.c +++ b/hw/audio/pcspk.c @@ -26,7 +26,7 @@ #include "hw/hw.h" #include "hw/i386/pc.h" #include "hw/isa/isa.h" -#include "hw/audio/audio.h" +#include "hw/audio/soundhw.h" #include "audio/audio.h" #include "qemu/timer.h" #include "hw/timer/i8254.h" diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c index 6b4427f242..6ab2f6f89a 100644 --- a/hw/audio/sb16.c +++ b/hw/audio/sb16.c @@ -23,7 +23,7 @@ */ #include "qemu/osdep.h" #include "hw/hw.h" -#include "hw/audio/audio.h" +#include "hw/audio/soundhw.h" #include "audio/audio.h" #include "hw/isa/isa.h" #include "hw/qdev.h" diff --git a/hw/audio/soundhw.c b/hw/audio/soundhw.c index 29565da93d..e698909d34 100644 --- a/hw/audio/soundhw.c +++ b/hw/audio/soundhw.c @@ -28,7 +28,7 @@ #include "qom/object.h" #include "hw/isa/isa.h" #include "hw/pci/pci.h" -#include "hw/audio/audio.h" +#include "hw/audio/soundhw.h" struct soundhw { const char *name; diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index 4a7d2cfbe0..d16646c95d 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -36,7 +36,7 @@ #include "hw/pci/pci_host.h" #include "hw/ppc/ppc.h" #include "hw/boards.h" -#include "hw/audio/audio.h" +#include "hw/audio/soundhw.h" #include "qemu/error-report.h" #include "qemu/log.h" #include "hw/ide.h" diff --git a/include/hw/audio/audio.h b/include/hw/audio/audio.h deleted file mode 100644 index 119f7d78d5..0000000000 --- a/include/hw/audio/audio.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef HW_AUDIO_H -#define HW_AUDIO_H - -void isa_register_soundhw(const char *name, const char *descr, - int (*init_isa)(ISABus *bus)); - -void pci_register_soundhw(const char *name, const char *descr, - int (*init_pci)(PCIBus *bus)); - -void soundhw_init(void); -void select_soundhw(const char *optarg); - -#endif diff --git a/include/hw/audio/soundhw.h b/include/hw/audio/soundhw.h new file mode 100644 index 0000000000..119f7d78d5 --- /dev/null +++ b/include/hw/audio/soundhw.h @@ -0,0 +1,13 @@ +#ifndef HW_AUDIO_H +#define HW_AUDIO_H + +void isa_register_soundhw(const char *name, const char *descr, + int (*init_isa)(ISABus *bus)); + +void pci_register_soundhw(const char *name, const char *descr, + int (*init_pci)(PCIBus *bus)); + +void soundhw_init(void); +void select_soundhw(const char *optarg); + +#endif diff --git a/vl.c b/vl.c index 8f08f422a7..4d5eb6d215 100644 --- a/vl.c +++ b/vl.c @@ -89,7 +89,7 @@ int main(int argc, char **argv) #include "migration/block.h" #include "sysemu/tpm.h" #include "sysemu/dma.h" -#include "hw/audio/audio.h" +#include "hw/audio/soundhw.h" #include "audio/audio.h" #include "migration/migration.h" #include "sysemu/cpus.h" -- cgit v1.2.3-55-g7522