[PATCH v3 08/35] hw/audio: drop audio_model.isa

marcandre.lureau@redhat.com posted 35 patches 3 days ago
Maintainers: Gerd Hoffmann <kraxel@redhat.com>, Christian Schoenebeck <qemu_oss@crudebyte.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>, Thomas Huth <huth@tuxfamily.org>, Alexandre Ratchov <alex@caoua.org>, Peter Maydell <peter.maydell@linaro.org>, Jan Kiszka <jan.kiszka@web.de>, Alistair Francis <alistair@alistair23.me>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Laurent Vivier <laurent@vivier.eu>, "Michael S. Tsirkin" <mst@redhat.com>, Manos Pitsidianakis <manos.pitsidianakis@linaro.org>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Yanan Wang <wangyanan55@huawei.com>, Zhao Liu <zhao1.liu@intel.com>, Paolo Bonzini <pbonzini@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, "Hervé Poussineau" <hpoussin@reactos.org>, BALATON Zoltan <balaton@eik.bme.hu>, Jiaxun Yang <jiaxun.yang@flygoat.com>, "Alex Bennée" <alex.bennee@linaro.org>
[PATCH v3 08/35] hw/audio: drop audio_model.isa
Posted by marcandre.lureau@redhat.com 3 days ago
From: Marc-André Lureau <marcandre.lureau@redhat.com>

That's no longer necessary, the code is bus-agnostic.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/hw/audio/model.h  | 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/model.c          | 8 +-------
 hw/audio/sb16.c           | 2 +-
 hw/audio/virtio-snd-pci.c | 2 +-
 9 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/include/hw/audio/model.h b/include/hw/audio/model.h
index 4d0be93042..c38b359413 100644
--- a/include/hw/audio/model.h
+++ b/include/hw/audio/model.h
@@ -5,7 +5,7 @@
 void audio_register_model_with_cb(const char *name, const char *descr,
                                   void (*init_audio_model)(const char *audiodev));
 void audio_register_model(const char *name, const char *descr,
-                          int isa, const char *typename);
+                          const char *typename);
 
 void audio_model_init(void);
 void audio_print_available_models(void);
diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c
index 9dee5bb143..6b9013ebb8 100644
--- a/hw/audio/ac97.c
+++ b/hw/audio/ac97.c
@@ -1362,7 +1362,7 @@ static const TypeInfo ac97_info = {
 static void ac97_register_types(void)
 {
     type_register_static(&ac97_info);
-    audio_register_model("ac97", "Intel 82801AA AC97 Audio", 0, TYPE_AC97);
+    audio_register_model("ac97", "Intel 82801AA AC97 Audio", TYPE_AC97);
 }
 
 type_init(ac97_register_types)
diff --git a/hw/audio/adlib.c b/hw/audio/adlib.c
index d0b2817843..6aae365f47 100644
--- a/hw/audio/adlib.c
+++ b/hw/audio/adlib.c
@@ -323,7 +323,7 @@ static const TypeInfo adlib_info = {
 static void adlib_register_types (void)
 {
     type_register_static (&adlib_info);
-    audio_register_model("adlib", ADLIB_DESC, 1, TYPE_ADLIB);
+    audio_register_model("adlib", ADLIB_DESC, TYPE_ADLIB);
 }
 
 type_init (adlib_register_types)
diff --git a/hw/audio/cs4231a.c b/hw/audio/cs4231a.c
index 0979cf5f16..3b80a61378 100644
--- a/hw/audio/cs4231a.c
+++ b/hw/audio/cs4231a.c
@@ -723,7 +723,7 @@ static const TypeInfo cs4231a_info = {
 static void cs4231a_register_types (void)
 {
     type_register_static (&cs4231a_info);
-    audio_register_model("cs4231a", "CS4231A", 1, TYPE_CS4231A);
+    audio_register_model("cs4231a", "CS4231A", TYPE_CS4231A);
 }
 
 type_init (cs4231a_register_types)
diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c
index 066b9906fa..721c02be0a 100644
--- a/hw/audio/es1370.c
+++ b/hw/audio/es1370.c
@@ -905,7 +905,7 @@ static const TypeInfo es1370_info = {
 static void es1370_register_types (void)
 {
     type_register_static (&es1370_info);
-    audio_register_model("es1370", "ENSONIQ AudioPCI ES1370", 0, TYPE_ES1370);
+    audio_register_model("es1370", "ENSONIQ AudioPCI ES1370", TYPE_ES1370);
 }
 
 type_init (es1370_register_types)
diff --git a/hw/audio/gus.c b/hw/audio/gus.c
index d5b1e62135..45ea04bf89 100644
--- a/hw/audio/gus.c
+++ b/hw/audio/gus.c
@@ -320,7 +320,7 @@ static const TypeInfo gus_info = {
 static void gus_register_types (void)
 {
     type_register_static (&gus_info);
-    audio_register_model("gus", "Gravis Ultrasound GF1", 1, TYPE_GUS);
+    audio_register_model("gus", "Gravis Ultrasound GF1", TYPE_GUS);
 }
 
 type_init (gus_register_types)
diff --git a/hw/audio/model.c b/hw/audio/model.c
index 7af0d960f5..40929c6e77 100644
--- a/hw/audio/model.c
+++ b/hw/audio/model.c
@@ -26,16 +26,13 @@
 #include "monitor/qdev.h"
 #include "qemu/error-report.h"
 #include "qapi/error.h"
-#include "qom/object.h"
 #include "hw/qdev-properties.h"
-#include "hw/isa/isa.h"
 #include "hw/audio/model.h"
 
 struct audio_model {
     const char *name;
     const char *descr;
     const char *typename;
-    int isa;
     void (*init)(const char *audiodev);
 };
 
@@ -48,18 +45,16 @@ void audio_register_model_with_cb(const char *name, const char *descr,
     assert(audio_models_count < ARRAY_SIZE(audio_models) - 1);
     audio_models[audio_models_count].name = name;
     audio_models[audio_models_count].descr = descr;
-    audio_models[audio_models_count].isa = 0;
     audio_models[audio_models_count].init = init_audio_model;
     audio_models_count++;
 }
 
 void audio_register_model(const char *name, const char *descr,
-                          int isa, const char *typename)
+                          const char *typename)
 {
     assert(audio_models_count < ARRAY_SIZE(audio_models) - 1);
     audio_models[audio_models_count].name = name;
     audio_models[audio_models_count].descr = descr;
-    audio_models[audio_models_count].isa = isa;
     audio_models[audio_models_count].typename = typename;
     audio_models_count++;
 }
@@ -120,7 +115,6 @@ void audio_model_init(void)
         qdev_prop_set_string(dev, "audiodev", audiodev_id);
         qdev_realize_and_unref(dev, bus, &error_fatal);
     } else {
-        assert(!c->isa);
         c->init(audiodev_id);
     }
 }
diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c
index 5faa3f5fe3..e86aafd488 100644
--- a/hw/audio/sb16.c
+++ b/hw/audio/sb16.c
@@ -1470,7 +1470,7 @@ static const TypeInfo sb16_info = {
 static void sb16_register_types (void)
 {
     type_register_static (&sb16_info);
-    audio_register_model("sb16", "Creative Sound Blaster 16", 1, TYPE_SB16);
+    audio_register_model("sb16", "Creative Sound Blaster 16", TYPE_SB16);
 }
 
 type_init (sb16_register_types)
diff --git a/hw/audio/virtio-snd-pci.c b/hw/audio/virtio-snd-pci.c
index b78eaff851..230581ed63 100644
--- a/hw/audio/virtio-snd-pci.c
+++ b/hw/audio/virtio-snd-pci.c
@@ -74,7 +74,7 @@ static const VirtioPCIDeviceTypeInfo virtio_snd_pci_info = {
 static void virtio_snd_pci_register(void)
 {
     virtio_pci_types_register(&virtio_snd_pci_info);
-    audio_register_model("virtio", "Virtio Sound", 0, TYPE_VIRTIO_SND_PCI);
+    audio_register_model("virtio", "Virtio Sound", TYPE_VIRTIO_SND_PCI);
 }
 
 type_init(virtio_snd_pci_register);
-- 
2.51.0