qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH arm-devs v4 4/4] cpu/a9mpcore: Add Global Timer


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH arm-devs v4 4/4] cpu/a9mpcore: Add Global Timer
Date: Mon, 02 Dec 2013 14:21:59 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9

Il 02/12/2013 14:08, Andreas Färber ha scritto:
>> > +    object_initialize(&s->gtimer, sizeof(s->gtimer), TYPE_A9_GTIMER);
>> > +    qdev_set_parent_bus(DEVICE(&s->gtimer), sysbus_get_default());
>> > +
>> >      object_initialize(&s->mptimer, sizeof(s->mptimer), TYPE_ARM_MPTIMER);
>> >      qdev_set_parent_bus(DEVICE(&s->mptimer), sysbus_get_default());
>> >  
> This code resulted from inlining qdev_create() and switching to in-place
> instantiation.
> 
> Seeing this repetitive code again and again makes me wonder whether we
> can just set a SysBusDevice's parent_bus in its instance_init function
> to simplify it?

Could we do it instead in the init function, only if parent_bus is still
NULL?

Paolo



reply via email to

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