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>
diff --git a/hw/smbus.c b/hw/smbus.c
index 6bea4fa..5618902 100644
--- a/hw/smbus.c
+++ b/hw/smbus.c
@@ -206,14 +206,14 @@
t->init(dev);
}
-void smbus_register_device(const char *name, int size, SMBusDeviceInfo *info)
+void smbus_register_device(SMBusDeviceInfo *info)
{
- assert(size >= sizeof(SMBusDevice));
+ assert(info->i2c.qdev.size >= sizeof(SMBusDevice));
info->i2c.init = smbus_device_init;
info->i2c.event = smbus_i2c_event;
info->i2c.recv = smbus_i2c_recv;
info->i2c.send = smbus_i2c_send;
- i2c_register_slave(name, size, &info->i2c);
+ i2c_register_slave(&info->i2c);
}
/* Master device commands. */