[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 21/21] core/sysbus: remove the SysBusDeviceClass:
From: |
Mao Zhongyi |
Subject: |
[Qemu-devel] [PATCH v3 21/21] core/sysbus: remove the SysBusDeviceClass::init path |
Date: |
Fri, 30 Nov 2018 17:38:52 +0800 |
Currently, all sysbus devices have been converted to realize(),
so remove this path.
Cc: address@hidden
Cc: address@hidden
Cc: address@hidden
Cc: address@hidden
Cc: address@hidden
Cc: address@hidden
Cc: address@hidden
Signed-off-by: Mao Zhongyi <address@hidden>
Signed-off-by: Zhang Shengju <address@hidden>
---
hw/core/sysbus.c | 15 +++++----------
include/hw/sysbus.h | 3 ---
2 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c
index 7ac36ad3e7..9f9edbcab9 100644
--- a/hw/core/sysbus.c
+++ b/hw/core/sysbus.c
@@ -201,18 +201,13 @@ void sysbus_init_ioports(SysBusDevice *dev, uint32_t
ioport, uint32_t size)
}
}
-/* TODO remove once all sysbus devices have been converted to realize */
+/* The purpose of preserving this empty realize function
+ * is to prevent the parent_realize field of some subclasses
+ * from being set to NULL to break the normal init/realize
+ * of some devices.
+ */
static void sysbus_realize(DeviceState *dev, Error **errp)
{
- SysBusDevice *sd = SYS_BUS_DEVICE(dev);
- SysBusDeviceClass *sbc = SYS_BUS_DEVICE_GET_CLASS(sd);
-
- if (!sbc->init) {
- return;
- }
- if (sbc->init(sd) < 0) {
- error_setg(errp, "Device initialization failed");
- }
}
DeviceState *sysbus_create_varargs(const char *name,
diff --git a/include/hw/sysbus.h b/include/hw/sysbus.h
index 0b59a3b8d6..1aedcf05c9 100644
--- a/include/hw/sysbus.h
+++ b/include/hw/sysbus.h
@@ -38,9 +38,6 @@ typedef struct SysBusDevice SysBusDevice;
typedef struct SysBusDeviceClass {
/*< private >*/
DeviceClass parent_class;
- /*< public >*/
-
- int (*init)(SysBusDevice *dev);
/*
* Let the sysbus device format its own non-PIO, non-MMIO unit address.
--
2.17.1
- [Qemu-devel] [PATCH v3 03/21] char/grlib_apbuart: Convert sysbus init function to realize function, (continued)
- [Qemu-devel] [PATCH v3 03/21] char/grlib_apbuart: Convert sysbus init function to realize function, Mao Zhongyi, 2018/11/30
- [Qemu-devel] [PATCH v3 20/21] xen_backend: remove xen_sysdev_init() function, Mao Zhongyi, 2018/11/30
- [Qemu-devel] [PATCH v3 04/21] core/empty_slot: Convert sysbus init function to realize function, Mao Zhongyi, 2018/11/30
- [Qemu-devel] [PATCH v3 11/21] milkymist-hpdmc: Convert sysbus init function to realize function, Mao Zhongyi, 2018/11/30
- [Qemu-devel] [PATCH v3 05/21] display/g364fb: Convert sysbus init function to realize function, Mao Zhongyi, 2018/11/30
- [Qemu-devel] [PATCH v3 10/21] intc/puv3_intc: Convert sysbus init function to realize function, Mao Zhongyi, 2018/11/30
- [Qemu-devel] [PATCH v3 16/21] timer/etraxfs_timer: Convert sysbus init function to realize function, Mao Zhongyi, 2018/11/30
- [Qemu-devel] [PATCH v3 13/21] puv3_pm.c: Convert sysbus init function to realize function, Mao Zhongyi, 2018/11/30
- [Qemu-devel] [PATCH v3 18/21] timer/puv3_ost: Convert sysbus init function to realize function, Mao Zhongyi, 2018/11/30
- [Qemu-devel] [PATCH v3 06/21] dma/puv3_dma: Convert sysbus init function to realize function, Mao Zhongyi, 2018/11/30
- [Qemu-devel] [PATCH v3 21/21] core/sysbus: remove the SysBusDeviceClass::init path,
Mao Zhongyi <=
- [Qemu-devel] [PATCH v3 19/21] usb/tusb6010: Convert sysbus init function to realize function, Mao Zhongyi, 2018/11/30
- [Qemu-devel] [PATCH v3 15/21] pci-bridge/dec: Convert sysbus init function to realize function, Mao Zhongyi, 2018/11/30
- Re: [Qemu-devel] [PATCH v3 00/21] QOM'ify SysBusDeviceClass->init, Peter Maydell, 2018/11/30