diff mbox series

[4/5] hw/ppc/e500: Inline sysbus_create_simple(E500_SPIN)

Message ID 20231030143957.82988-5-philmd@linaro.org
State New
Headers show
Series hw/ppc/e500: Pass array of CPUs as array of canonical QOM paths | expand

Commit Message

Philippe Mathieu-Daudé Oct. 30, 2023, 2:39 p.m. UTC
In the next commit we'll set properties to the TYPE_E500_SPIN
object. In order to ease next commit review, inline the
sysbus_create_simple() call first.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/ppc/e500.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Daniel Henrique Barboza Oct. 31, 2023, 9:03 p.m. UTC | #1
On 10/30/23 11:39, Philippe Mathieu-Daudé wrote:
> In the next commit we'll set properties to the TYPE_E500_SPIN
> object. In order to ease next commit review, inline the
> sysbus_create_simple() call first.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---

Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>

>   hw/ppc/e500.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
> index f8177c0280..e38f46df38 100644
> --- a/hw/ppc/e500.c
> +++ b/hw/ppc/e500.c
> @@ -1082,7 +1082,9 @@ void ppce500_init(MachineState *machine)
>       }
>   
>       /* Register spinning region */
> -    sysbus_create_simple("e500-spin", pmc->spin_base, NULL);
> +    dev = qdev_new("e500-spin");
> +    sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
> +    sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, pmc->spin_base);
>   
>       if (pmc->has_mpc8xxx_gpio) {
>           qemu_irq poweroff_irq;
diff mbox series

Patch

diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index f8177c0280..e38f46df38 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -1082,7 +1082,9 @@  void ppce500_init(MachineState *machine)
     }
 
     /* Register spinning region */
-    sysbus_create_simple("e500-spin", pmc->spin_base, NULL);
+    dev = qdev_new("e500-spin");
+    sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
+    sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, pmc->spin_base);
 
     if (pmc->has_mpc8xxx_gpio) {
         qemu_irq poweroff_irq;