[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 13/19] hw/m68k: Set QDev properties using QDev API
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 13/19] hw/m68k: Set QDev properties using QDev API |
Date: |
Fri, 3 Feb 2023 19:09:08 +0100 |
No need to use the low-level QOM API when an object
inherits from QDev. Directly use the QDev API to set
its properties.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/m68k/next-cube.c | 2 +-
hw/m68k/q800.c | 7 +++----
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c
index e0d4a94f9d..460b84c6e6 100644
--- a/hw/m68k/next-cube.c
+++ b/hw/m68k/next-cube.c
@@ -966,7 +966,7 @@ static void next_cube_init(MachineState *machine)
/* Peripheral Controller */
pcdev = qdev_new(TYPE_NEXT_PC);
- object_property_set_link(OBJECT(pcdev), "cpu", OBJECT(cpu), &error_abort);
+ qdev_prop_set_link(pcdev, "cpu", OBJECT(cpu));
sysbus_realize_and_unref(SYS_BUS_DEVICE(pcdev), &error_fatal);
/* 64MB RAM starting at 0x04000000 */
diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c
index 9d52ca6613..1f363a666c 100644
--- a/hw/m68k/q800.c
+++ b/hw/m68k/q800.c
@@ -427,7 +427,7 @@ static void q800_init(MachineState *machine)
/* IRQ Glue */
glue = qdev_new(TYPE_GLUE);
- object_property_set_link(OBJECT(glue), "cpu", OBJECT(cpu), &error_abort);
+ qdev_prop_set_link(glue, "cpu", OBJECT(cpu));
sysbus_realize_and_unref(SYS_BUS_DEVICE(glue), &error_fatal);
/* VIA 1 */
@@ -483,8 +483,7 @@ static void q800_init(MachineState *machine)
qdev_set_nic_properties(dev, &nd_table[0]);
qdev_prop_set_uint8(dev, "it_shift", 2);
qdev_prop_set_bit(dev, "big_endian", true);
- object_property_set_link(OBJECT(dev), "dma_mr",
- OBJECT(get_system_memory()), &error_abort);
+ qdev_prop_set_link(dev, "dma_mr", OBJECT(get_system_memory()));
sysbus = SYS_BUS_DEVICE(dev);
sysbus_realize_and_unref(sysbus, &error_fatal);
sysbus_mmio_map(sysbus, 0, SONIC_BASE);
@@ -520,7 +519,7 @@ static void q800_init(MachineState *machine)
/* Logically OR both its IRQs together */
escc_orgate = DEVICE(object_new(TYPE_OR_IRQ));
- object_property_set_int(OBJECT(escc_orgate), "num-lines", 2, &error_fatal);
+ qdev_prop_set_uint16(escc_orgate, "num-lines", 2);
qdev_realize_and_unref(escc_orgate, NULL, &error_fatal);
sysbus_connect_irq(sysbus, 0, qdev_get_gpio_in(escc_orgate, 0));
sysbus_connect_irq(sysbus, 1, qdev_get_gpio_in(escc_orgate, 1));
--
2.38.1
- [PATCH 04/19] hw/audio: Set QDev properties using QDev API, (continued)
- [PATCH 04/19] hw/audio: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [RFC PATCH 05/19] hw/core/numa: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 06/19] hw/core/gpio: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [RFC PATCH 07/19] hw/scsi: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 08/19] hw/usb: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 10/19] hw/avr: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 09/19] hw/virtio: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 11/19] hw/hppa: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [RFC PATCH 12/19] hw/i386: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 13/19] hw/m68k: Set QDev properties using QDev API,
Philippe Mathieu-Daudé <=
- [PATCH 14/19] hw/microblaze: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [RFC PATCH 15/19] hw/mips: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 16/19] hw/nios2: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [RFC PATCH 17/19] hw/riscv: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 18/19] hw/rx: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 19/19] hw/sparc: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- Re: [PATCH 00/19] hw: Set QDev properties using QDev API (part 1/3), Philippe Mathieu-Daudé, 2023/02/03