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

@ -239,6 +239,8 @@ static void tmp105_init(i2c_slave *i2c)
}
static I2CSlaveInfo tmp105_info = {
.qdev.name = "tmp105",
.qdev.size = sizeof(TMP105State),
.init = tmp105_init,
.event = tmp105_event,
.recv = tmp105_rx,
@ -247,7 +249,7 @@ static I2CSlaveInfo tmp105_info = {
static void tmp105_register_devices(void)
{
i2c_register_slave("tmp105", sizeof(TMP105State), &tmp105_info);
i2c_register_slave(&tmp105_info);
}
device_init(tmp105_register_devices)