[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/35] vt82c686: Remove vt82c686b_[am]c97_init() functions
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 10/35] vt82c686: Remove vt82c686b_[am]c97_init() functions |
Date: |
Sun, 3 Jan 2021 21:49:56 +0100 |
From: BALATON Zoltan <balaton@eik.bme.hu>
These are legacy init functions that are just equivalent to directly
calling pci_create_simple so do that instead. Also rename objects to
lower case via-ac97 and via-mc97 matching naming of other devices.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id:
<1c4373c8aeb6c4fb2a8df2c864b0e91a977a3d7b.1609584216.git.balaton@eik.bme.hu>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
include/hw/isa/vt82c686.h | 4 ++--
hw/isa/vt82c686.c | 27 ++++-----------------------
hw/mips/fuloong2e.c | 4 ++--
3 files changed, 8 insertions(+), 27 deletions(-)
diff --git a/include/hw/isa/vt82c686.h b/include/hw/isa/vt82c686.h
index f23f45dfb1d..ff80a926dcb 100644
--- a/include/hw/isa/vt82c686.h
+++ b/include/hw/isa/vt82c686.h
@@ -3,11 +3,11 @@
#define TYPE_VT82C686B_SUPERIO "vt82c686b-superio"
+#define TYPE_VIA_AC97 "via-ac97"
+#define TYPE_VIA_MC97 "via-mc97"
/* vt82c686.c */
ISABus *vt82c686b_isa_init(PCIBus * bus, int devfn);
-void vt82c686b_ac97_init(PCIBus *bus, int devfn);
-void vt82c686b_mc97_init(PCIBus *bus, int devfn);
I2CBus *vt82c686b_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base,
qemu_irq sci_irq);
diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
index d40599c7daa..8677a2d212b 100644
--- a/hw/isa/vt82c686.c
+++ b/hw/isa/vt82c686.c
@@ -179,12 +179,6 @@ struct VIAMC97State {
#define TYPE_VT82C686B_PM "VT82C686B_PM"
OBJECT_DECLARE_SIMPLE_TYPE(VT686PMState, VT82C686B_PM)
-#define TYPE_VIA_MC97 "VIA_MC97"
-OBJECT_DECLARE_SIMPLE_TYPE(VIAMC97State, VIA_MC97)
-
-#define TYPE_VIA_AC97 "VIA_AC97"
-OBJECT_DECLARE_SIMPLE_TYPE(VIAAC97State, VIA_AC97)
-
static void pm_update_sci(VT686PMState *s)
{
int sci_level, pmsts;
@@ -254,10 +248,13 @@ static const VMStateDescription vmstate_acpi = {
};
/*
- * TODO: vt82c686b_ac97_init() and vt82c686b_mc97_init()
+ * TODO: VIA_AC97 and VIA_MC97
* just register a PCI device now, functionalities will be implemented later.
*/
+OBJECT_DECLARE_SIMPLE_TYPE(VIAMC97State, VIA_MC97)
+OBJECT_DECLARE_SIMPLE_TYPE(VIAAC97State, VIA_AC97)
+
static void vt82c686b_ac97_realize(PCIDevice *dev, Error **errp)
{
VIAAC97State *s = VIA_AC97(dev);
@@ -270,14 +267,6 @@ static void vt82c686b_ac97_realize(PCIDevice *dev, Error
**errp)
pci_set_long(pci_conf + PCI_INTERRUPT_PIN, 0x03);
}
-void vt82c686b_ac97_init(PCIBus *bus, int devfn)
-{
- PCIDevice *dev;
-
- dev = pci_new(devfn, TYPE_VIA_AC97);
- pci_realize_and_unref(dev, bus, &error_fatal);
-}
-
static void via_ac97_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
@@ -314,14 +303,6 @@ static void vt82c686b_mc97_realize(PCIDevice *dev, Error
**errp)
pci_set_long(pci_conf + PCI_INTERRUPT_PIN, 0x03);
}
-void vt82c686b_mc97_init(PCIBus *bus, int devfn)
-{
- PCIDevice *dev;
-
- dev = pci_new(devfn, TYPE_VIA_MC97);
- pci_realize_and_unref(dev, bus, &error_fatal);
-}
-
static void via_mc97_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c
index 45c596f4fe5..8287e65c52c 100644
--- a/hw/mips/fuloong2e.c
+++ b/hw/mips/fuloong2e.c
@@ -262,8 +262,8 @@ static void vt82c686b_southbridge_init(PCIBus *pci_bus, int
slot, qemu_irq intc,
*i2c_bus = vt82c686b_pm_init(pci_bus, PCI_DEVFN(slot, 4), 0xeee1, NULL);
/* Audio support */
- vt82c686b_ac97_init(pci_bus, PCI_DEVFN(slot, 5));
- vt82c686b_mc97_init(pci_bus, PCI_DEVFN(slot, 6));
+ pci_create_simple(pci_bus, PCI_DEVFN(slot, 5), TYPE_VIA_AC97);
+ pci_create_simple(pci_bus, PCI_DEVFN(slot, 6), TYPE_VIA_MC97);
}
/* Network support */
--
2.26.2
- [PULL 00/35] MIPS patches for 2021-01-03, Philippe Mathieu-Daudé, 2021/01/03
- [PULL 01/35] hw/pci-host: Use the PCI_BUILD_BDF() macro from 'hw/pci/pci.h', Philippe Mathieu-Daudé, 2021/01/03
- [PULL 02/35] hw/pci-host/uninorth: Use the PCI_FUNC() macro from 'hw/pci/pci.h', Philippe Mathieu-Daudé, 2021/01/03
- [PULL 03/35] hw: Use the PCI_SLOT() macro from 'hw/pci/pci.h', Philippe Mathieu-Daudé, 2021/01/03
- [PULL 04/35] hw: Use the PCI_DEVFN() macro from 'hw/pci/pci.h', Philippe Mathieu-Daudé, 2021/01/03
- [PULL 05/35] hw/pci-host/bonito: Display hexadecimal value with '0x' prefix, Philippe Mathieu-Daudé, 2021/01/03
- [PULL 06/35] hw/pci-host/bonito: Use pci_config_set_interrupt_pin(), Philippe Mathieu-Daudé, 2021/01/03
- [PULL 07/35] vt82c686: Rename AC97/MC97 parts from VT82C686B to VIA, Philippe Mathieu-Daudé, 2021/01/03
- [PULL 08/35] vt82c686: Remove unnecessary _DEVICE suffix from type macros, Philippe Mathieu-Daudé, 2021/01/03
- [PULL 09/35] vt82c686: Rename VT82C686B to VT82C686B_ISA, Philippe Mathieu-Daudé, 2021/01/03
- [PULL 10/35] vt82c686: Remove vt82c686b_[am]c97_init() functions,
Philippe Mathieu-Daudé <=
- [PULL 11/35] vt82c686: Split off via-[am]c97 into separate file in hw/audio, Philippe Mathieu-Daudé, 2021/01/03
- [PULL 12/35] audio/via-ac97: Simplify code and set user_creatable to false, Philippe Mathieu-Daudé, 2021/01/03
- [PULL 13/35] vt82c686: Remove legacy vt82c686b_isa_init() function, Philippe Mathieu-Daudé, 2021/01/03
- [PULL 14/35] vt82c686: Remove legacy vt82c686b_pm_init() function, Philippe Mathieu-Daudé, 2021/01/03
- [PULL 15/35] vt82c686: Convert debug printf to trace points, Philippe Mathieu-Daudé, 2021/01/03
- [PULL 17/35] vt82c686: Use shorter name for local variable holding object state, Philippe Mathieu-Daudé, 2021/01/03
- [PULL 16/35] vt82c686: Remove unneeded includes and defines, Philippe Mathieu-Daudé, 2021/01/03
- [PULL 18/35] vt82c686: Rename superio config related parts, Philippe Mathieu-Daudé, 2021/01/03
- [PULL 19/35] clock: Introduce clock_ticks_to_ns(), Philippe Mathieu-Daudé, 2021/01/03
- [PULL 20/35] target/mips: Don't use clock_get_ns() in clock period calculation, Philippe Mathieu-Daudé, 2021/01/03