[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 02/37] sysbus: remove unused sysbus_try_create*
From: |
Marc-André Lureau |
Subject: |
[PATCH v4 02/37] sysbus: remove unused sysbus_try_create* |
Date: |
Wed, 20 Nov 2019 19:24:07 +0400 |
Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
---
hw/core/sysbus.c | 32 --------------------------------
hw/i386/pc.c | 1 -
include/hw/sysbus.h | 9 +--------
3 files changed, 1 insertion(+), 41 deletions(-)
diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c
index 9e69c83aed..08b0311c5f 100644
--- a/hw/core/sysbus.c
+++ b/hw/core/sysbus.c
@@ -250,38 +250,6 @@ DeviceState *sysbus_create_varargs(const char *name,
return dev;
}
-DeviceState *sysbus_try_create_varargs(const char *name,
- hwaddr addr, ...)
-{
- DeviceState *dev;
- SysBusDevice *s;
- va_list va;
- qemu_irq irq;
- int n;
-
- dev = qdev_try_create(NULL, name);
- if (!dev) {
- return NULL;
- }
- s = SYS_BUS_DEVICE(dev);
- qdev_init_nofail(dev);
- if (addr != (hwaddr)-1) {
- sysbus_mmio_map(s, 0, addr);
- }
- va_start(va, addr);
- n = 0;
- while (1) {
- irq = va_arg(va, qemu_irq);
- if (!irq) {
- break;
- }
- sysbus_connect_irq(s, n, irq);
- n++;
- }
- va_end(va);
- return dev;
-}
-
static void sysbus_dev_print(Monitor *mon, DeviceState *dev, int indent)
{
SysBusDevice *s = SYS_BUS_DEVICE(dev);
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index ac08e63604..49e2259327 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1399,7 +1399,6 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
* when the HPET wants to take over. Thus we have to disable the latter.
*/
if (!no_hpet && (!kvm_irqchip_in_kernel() || kvm_has_pit_state2())) {
- /* In order to set property, here not using sysbus_try_create_simple */
hpet = qdev_try_create(NULL, TYPE_HPET);
if (hpet) {
/* For pc-piix-*, hpet's intcap is always IRQ2. For pc-q35-1.7
diff --git a/include/hw/sysbus.h b/include/hw/sysbus.h
index 27e80881da..2eb0484388 100644
--- a/include/hw/sysbus.h
+++ b/include/hw/sysbus.h
@@ -117,8 +117,7 @@ void foreach_dynamic_sysbus_device(FindSysbusDeviceFunc
*func, void *opaque);
/* Legacy helper function for creating devices. */
DeviceState *sysbus_create_varargs(const char *name,
hwaddr addr, ...);
-DeviceState *sysbus_try_create_varargs(const char *name,
- hwaddr addr, ...);
+
static inline DeviceState *sysbus_create_simple(const char *name,
hwaddr addr,
qemu_irq irq)
@@ -126,11 +125,5 @@ static inline DeviceState *sysbus_create_simple(const char
*name,
return sysbus_create_varargs(name, addr, irq, NULL);
}
-static inline DeviceState *sysbus_try_create_simple(const char *name,
- hwaddr addr,
- qemu_irq irq)
-{
- return sysbus_try_create_varargs(name, addr, irq, NULL);
-}
#endif /* HW_SYSBUS_H */
--
2.24.0
- [PATCH v4 00/37] Clean-ups: qom-ify serial and remove QDEV_PROP_PTR, Marc-André Lureau, 2019/11/20
- [PATCH v4 01/37] qdev: remove unused qdev_prop_int64, Marc-André Lureau, 2019/11/20
- [PATCH v4 02/37] sysbus: remove unused sysbus_try_create*,
Marc-André Lureau <=
- [PATCH v4 03/37] sysbus: remove outdated comment, Marc-André Lureau, 2019/11/20
- [PATCH v4 04/37] chardev: generate an internal id when none given, Marc-André Lureau, 2019/11/20
- [PATCH v4 06/37] serial: initial qom-ification, Marc-André Lureau, 2019/11/20
- [PATCH v4 07/37] serial: register vmsd with DeviceClass, Marc-André Lureau, 2019/11/20
- [PATCH v4 05/37] serial-pci-multi: factor out multi_serial_get_port_count(), Marc-André Lureau, 2019/11/20
- [PATCH v4 08/37] serial: add "chardev" property, Marc-André Lureau, 2019/11/20
- [PATCH v4 09/37] serial: add "baudbase" property, Marc-André Lureau, 2019/11/20