From 074f2fff798cb8f9588080b740dc356217a24720 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Wed, 10 Jun 2009 09:41:42 +0200 Subject: 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 --- hw/max7310.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'hw/max7310.c') diff --git a/hw/max7310.c b/hw/max7310.c index 69ede32..a571e57 100644 --- a/hw/max7310.c +++ b/hw/max7310.c @@ -218,6 +218,8 @@ void max7310_gpio_out_set(i2c_slave *i2c, int line, qemu_irq handler) } static I2CSlaveInfo max7310_info = { + .qdev.name = "max7310", + .qdev.size = sizeof(MAX7310State), .init = max7310_init, .event = max7310_event, .recv = max7310_rx, @@ -226,7 +228,7 @@ static I2CSlaveInfo max7310_info = { static void max7310_register_devices(void) { - i2c_register_slave("max7310", sizeof(MAX7310State), &max7310_info); + i2c_register_slave(&max7310_info); } device_init(max7310_register_devices) -- cgit v1.1