Message ID | 20240216110313.17039-8-philmd@linaro.org |
---|---|
State | New |
Headers | show |
Series | hw: More QDev cleanups | expand |
On Fri, Feb 16, 2024 at 12:02:58PM +0100, Philippe Mathieu-Daudé wrote: > Date: Fri, 16 Feb 2024 12:02:58 +0100 > From: Philippe Mathieu-Daudé <philmd@linaro.org> > Subject: [PATCH 07/21] target: Replace DEVICE(object_new) -> qdev_new() > X-Mailer: git-send-email 2.41.0 > > Prefer QDev API for QDev objects, avoid the underlying QOM layer. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> > --- > target/mips/cpu.c | 2 +- > target/xtensa/cpu.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Zhao Liu <zhao1.liu@intel.com> > > diff --git a/target/mips/cpu.c b/target/mips/cpu.c > index d644adbc77..6b3909ee08 100644 > --- a/target/mips/cpu.c > +++ b/target/mips/cpu.c > @@ -649,7 +649,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); > qdev_realize(cpu, NULL, &error_abort); > > diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c > index 79f91819df..4f9408e1a0 100644 > --- a/target/xtensa/cpu.c > +++ b/target/xtensa/cpu.c > @@ -205,7 +205,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); > > -- > 2.41.0 > >
diff --git a/target/mips/cpu.c b/target/mips/cpu.c index d644adbc77..6b3909ee08 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -649,7 +649,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); qdev_realize(cpu, NULL, &error_abort); diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index 79f91819df..4f9408e1a0 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -205,7 +205,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);
Prefer QDev API for QDev objects, avoid the underlying QOM layer. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- target/mips/cpu.c | 2 +- target/xtensa/cpu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)