target: Replace DEVICE(object_new) -> qdev_new()
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Sat, 16 Dec 2023 02:07:33 +0000 (03:07 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 13 Jan 2025 16:06:35 +0000 (17:06 +0100)
Prefer QDev API for QDev objects, avoid the underlying QOM layer.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Message-Id: <20240216110313.17039-8-philmd@linaro.org>

target/mips/cpu.c
target/xtensa/cpu.c

index e3af02a4e6dc97f6a65ec0e15297b8712a0aab79..47cd7cfdcef502a614d6b23e6f6ce243ec3835b9 100644 (file)
@@ -644,7 +644,7 @@ MIPSCPU *mips_cpu_create_with_clock(const char *cpu_type, Clock *cpu_refclk,
 {
     DeviceState *cpu;
 
-    cpu = DEVICE(object_new(cpu_type));
+    cpu = qdev_new(cpu_type);
     qdev_connect_clock_in(cpu, "clk-in", cpu_refclk);
     object_property_set_bool(OBJECT(cpu), "big-endian", is_big_endian,
                              &error_abort);
index 0910a3d29044c24122dd0dc9874f16f890d32a0b..4eb699d1f456e21c6d0a98e59187ea911110a10f 100644 (file)
@@ -208,7 +208,7 @@ XtensaCPU *xtensa_cpu_create_with_clock(const char *cpu_type, Clock *cpu_refclk)
 {
     DeviceState *cpu;
 
-    cpu = DEVICE(object_new(cpu_type));
+    cpu = qdev_new(cpu_type);
     qdev_connect_clock_in(cpu, "clk-in", cpu_refclk);
     qdev_realize(cpu, NULL, &error_abort);