mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
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:
parent
57b452a848
commit
074f2fff79
27 changed files with 95 additions and 61 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue