qdev: move name+size into DeviceInfo (v2)

Rationale: move device information from code to data structures.

v2: Adapt the drivers missed in the first version.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Gerd Hoffmann 2009-06-10 09:41:42 +02:00 committed by Paul Brook
parent 57b452a848
commit 074f2fff79
27 changed files with 95 additions and 61 deletions

View file

@ -228,18 +228,17 @@ static void syborg_timer_init(SysBusDevice *dev)
static SysBusDeviceInfo syborg_timer_info = {
.init = syborg_timer_init,
.qdev = {
.props = (DevicePropList[]) {
{.name = "frequency", .type = PROP_TYPE_INT},
{.name = NULL}
}
.qdev.name = "syborg,timer",
.qdev.size = sizeof(SyborgTimerState),
.qdev.props = (DevicePropList[]) {
{.name = "frequency", .type = PROP_TYPE_INT},
{.name = NULL}
}
};
static void syborg_timer_register_devices(void)
{
sysbus_register_withprop("syborg,timer", sizeof(SyborgTimerState),
&syborg_timer_info);
sysbus_register_withprop(&syborg_timer_info);
}
device_init(syborg_timer_register_devices)