qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH RFC 04/15] misc/a9scu: QOM cleanups


From: Peter Crosthwaite
Subject: Re: [Qemu-devel] [PATCH RFC 04/15] misc/a9scu: QOM cleanups
Date: Mon, 1 Jul 2013 19:25:44 +1000

On Mon, Jul 1, 2013 at 7:00 AM, Andreas Färber <address@hidden> wrote:
> From: Andreas Färber <address@hidden>
>
> Rename A9SCUState::busdev field to parent_obj and turn realizefn into an
> instance_init function to allow early MMIO mapping.
>
> Signed-off-by: Andreas Färber <address@hidden>

Reviewed-by: Peter Crosthwaite <address@hidden>

> ---
>  hw/misc/a9scu.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/hw/misc/a9scu.c b/hw/misc/a9scu.c
> index 05897c2..30f6fac 100644
> --- a/hw/misc/a9scu.c
> +++ b/hw/misc/a9scu.c
> @@ -13,7 +13,10 @@
>  /* A9MP private memory region.  */
>
>  typedef struct A9SCUState {
> -    SysBusDevice busdev;
> +    /*< private >*/
> +    SysBusDevice parent_obj;
> +    /*< public >*/
> +
>      MemoryRegion iomem;
>      uint32_t control;
>      uint32_t status;
> @@ -114,10 +117,10 @@ static void a9_scu_reset(DeviceState *dev)
>      s->control = 0;
>  }
>
> -static void a9_scu_realize(DeviceState *dev, Error ** errp)
> +static void a9_scu_init(Object *obj)
>  {
> -    A9SCUState *s = A9_SCU(dev);
> -    SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
> +    A9SCUState *s = A9_SCU(obj);
> +    SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
>
>      memory_region_init_io(&s->iomem, &a9_scu_ops, s, "a9-scu", 0x100);
>      sysbus_init_mmio(sbd, &s->iomem);
> @@ -143,7 +146,6 @@ static void a9_scu_class_init(ObjectClass *klass, void 
> *data)
>  {
>      DeviceClass *dc = DEVICE_CLASS(klass);
>
> -    dc->realize = a9_scu_realize;
>      dc->props = a9_scu_properties;
>      dc->vmsd = &vmstate_a9_scu;
>      dc->reset = a9_scu_reset;
> @@ -153,6 +155,7 @@ static const TypeInfo a9_scu_info = {
>      .name          = TYPE_A9_SCU,
>      .parent        = TYPE_SYS_BUS_DEVICE,
>      .instance_size = sizeof(A9SCUState),
> +    .instance_init = a9_scu_init,
>      .class_init    = a9_scu_class_init,
>  };
>
> --
> 1.8.1.4
>
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]