[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 07/12] hw/mips/gt64xxx_pci: Convert gt64120_reset
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PATCH v2 07/12] hw/mips/gt64xxx_pci: Convert gt64120_reset() function into Device reset method |
Date: |
Tue, 2 Oct 2018 23:25:16 +0200 |
Convert the gt64120_reset() function into a proper Device reset method.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Reviewed-by: Cédric Le Goater <address@hidden>
---
hw/mips/gt64xxx_pci.c | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)
diff --git a/hw/mips/gt64xxx_pci.c b/hw/mips/gt64xxx_pci.c
index 24ad0ad024..dcd1a66329 100644
--- a/hw/mips/gt64xxx_pci.c
+++ b/hw/mips/gt64xxx_pci.c
@@ -992,9 +992,9 @@ static void gt64120_pci_set_irq(void *opaque, int irq_num,
int level)
}
-static void gt64120_reset(void *opaque)
+static void gt64120_reset(DeviceState *dev)
{
- GT64120State *s = opaque;
+ GT64120State *s = GT64120_PCI_HOST_BRIDGE(dev);
/* FIXME: Malta specific hw assumptions ahead */
@@ -1184,16 +1184,6 @@ PCIBus *gt64120_register(qemu_irq *pic)
return phb->bus;
}
-static int gt64120_init(SysBusDevice *dev)
-{
- GT64120State *s;
-
- s = GT64120_PCI_HOST_BRIDGE(dev);
-
- qemu_register_reset(gt64120_reset, s);
- return 0;
-}
-
static void gt64120_pci_realize(PCIDevice *d, Error **errp)
{
/* FIXME: Malta specific hw assumptions ahead */
@@ -1241,9 +1231,8 @@ static const TypeInfo gt64120_pci_info = {
static void gt64120_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
- SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass);
- sdc->init = gt64120_init;
+ dc->reset = gt64120_reset;
dc->vmsd = &vmstate_gt64120;
}
--
2.19.0
- [Qemu-devel] [PATCH v2 00/12] another SysBusDevice::init to Device::realize cleanup, Philippe Mathieu-Daudé, 2018/10/02
- [Qemu-devel] [PATCH v2 01/12] trace-events: Fix copy/paste typo, Philippe Mathieu-Daudé, 2018/10/02
- [Qemu-devel] [PATCH v2 03/12] hw/timer/sun4v-rtc: Use DeviceState::realize rather than SysBusDevice::init, Philippe Mathieu-Daudé, 2018/10/02
- [Qemu-devel] [PATCH v2 04/12] hw/ssi/xilinx_spi: Use DeviceState::realize rather than SysBusDevice::init, Philippe Mathieu-Daudé, 2018/10/02
- [Qemu-devel] [PATCH v2 02/12] hw/timer/sun4v-rtc: Convert from DPRINTF() macro to trace events, Philippe Mathieu-Daudé, 2018/10/02
- [Qemu-devel] [PATCH v2 06/12] hw/pci-host/bonito: Use DeviceState::realize rather than SysBusDevice::init, Philippe Mathieu-Daudé, 2018/10/02
- [Qemu-devel] [PATCH v2 05/12] hw/sh4/sh_pci: Use DeviceState::realize rather than SysBusDevice::init, Philippe Mathieu-Daudé, 2018/10/02
- [Qemu-devel] [PATCH v2 07/12] hw/mips/gt64xxx_pci: Convert gt64120_reset() function into Device reset method,
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH v2 08/12] hw/mips/gt64xxx_pci: Mark as bridge device, Philippe Mathieu-Daudé, 2018/10/02
- [Qemu-devel] [PATCH v2 11/12] hw/hppa/dino: Remove unuseful code, Philippe Mathieu-Daudé, 2018/10/02
- [Qemu-devel] [PATCH v2 12/12] hw/mips/malta: Remove unuseful code, Philippe Mathieu-Daudé, 2018/10/02
- [Qemu-devel] [PATCH v2 09/12] hw/sparc64/niagara: Model the I/O Bridge with the 'unimplemented_device', Philippe Mathieu-Daudé, 2018/10/02
- [Qemu-devel] [PATCH v2 10/12] hw/alpha/typhoon: Remove unuseful code, Philippe Mathieu-Daudé, 2018/10/02
- Re: [Qemu-devel] [PATCH v2 00/12] another SysBusDevice::init to Device::realize cleanup, Philippe Mathieu-Daudé, 2018/10/09