]> Git Repo - qemu.git/blobdiff - hw/misc/tmp105.c
hw/i2c: Use DeviceClass::realize instead of I2CSlaveClass::init
[qemu.git] / hw / misc / tmp105.c
index 9e22d64e36a0410a343fc8cbfe42a3f39b5544b2..0918f3a6ea21bfaa6e63ec069f5dc3b08e5f4f95 100644 (file)
@@ -229,15 +229,14 @@ static void tmp105_reset(I2CSlave *i2c)
     tmp105_interrupt_update(s);
 }
 
-static int tmp105_init(I2CSlave *i2c)
+static void tmp105_realize(DeviceState *dev, Error **errp)
 {
+    I2CSlave *i2c = I2C_SLAVE(dev);
     TMP105State *s = TMP105(i2c);
 
     qdev_init_gpio_out(&i2c->qdev, &s->pin, 1);
 
     tmp105_reset(&s->i2c);
-
-    return 0;
 }
 
 static void tmp105_initfn(Object *obj)
@@ -252,7 +251,7 @@ static void tmp105_class_init(ObjectClass *klass, void *data)
     DeviceClass *dc = DEVICE_CLASS(klass);
     I2CSlaveClass *k = I2C_SLAVE_CLASS(klass);
 
-    k->init = tmp105_init;
+    dc->realize = tmp105_realize;
     k->event = tmp105_event;
     k->recv = tmp105_rx;
     k->send = tmp105_tx;
This page took 0.022987 seconds and 4 git commands to generate.