mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 09:43: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
6
hw/i2c.c
6
hw/i2c.c
|
@ -152,12 +152,12 @@ static void i2c_slave_qdev_init(DeviceState *dev, DeviceInfo *base)
|
|||
info->init(s);
|
||||
}
|
||||
|
||||
void i2c_register_slave(const char *name, int size, I2CSlaveInfo *info)
|
||||
void i2c_register_slave(I2CSlaveInfo *info)
|
||||
{
|
||||
assert(size >= sizeof(i2c_slave));
|
||||
assert(info->qdev.size >= sizeof(i2c_slave));
|
||||
info->qdev.init = i2c_slave_qdev_init;
|
||||
info->qdev.bus_type = BUS_TYPE_I2C;
|
||||
qdev_register(name, size, &info->qdev);
|
||||
qdev_register(&info->qdev);
|
||||
}
|
||||
|
||||
DeviceState *i2c_create_slave(i2c_bus *bus, const char *name, int addr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue