aboutsummaryrefslogtreecommitdiff
path: root/hw/i2c/smbus_eeprom.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2018-05-28 16:45:06 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2018-06-01 15:14:31 +0200
commit19473e51cc1b019b1987261e1af8bc8b4a858f12 (patch)
tree12ecd7fe1b63118903bc472c97acd09e7b416da3 /hw/i2c/smbus_eeprom.c
parent244e2ad0dcddad68c3c4842eba7675fda79fa511 (diff)
downloadqemu-19473e51cc1b019b1987261e1af8bc8b4a858f12.zip
qemu-19473e51cc1b019b1987261e1af8bc8b4a858f12.tar.gz
qemu-19473e51cc1b019b1987261e1af8bc8b4a858f12.tar.bz2
hw/i2c/smbus: Use DeviceClass::realize instead of SMBusDeviceClass::init
SMBusDeviceClass::init is no more used, remove it. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20180419212727.26095-2-f4bug@amsat.org> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20180528144509.15812-2-armbru@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/i2c/smbus_eeprom.c')
-rw-r--r--hw/i2c/smbus_eeprom.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/hw/i2c/smbus_eeprom.c b/hw/i2c/smbus_eeprom.c
index b13ec0f..125c887 100644
--- a/hw/i2c/smbus_eeprom.c
+++ b/hw/i2c/smbus_eeprom.c
@@ -97,12 +97,11 @@ static uint8_t eeprom_read_data(SMBusDevice *dev, uint8_t cmd, int n)
return eeprom_receive_byte(dev);
}
-static int smbus_eeprom_initfn(SMBusDevice *dev)
+static void smbus_eeprom_realize(DeviceState *dev, Error **errp)
{
SMBusEEPROMDevice *eeprom = (SMBusEEPROMDevice *)dev;
eeprom->offset = 0;
- return 0;
}
static Property smbus_eeprom_properties[] = {
@@ -115,7 +114,7 @@ static void smbus_eeprom_class_initfn(ObjectClass *klass, void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
SMBusDeviceClass *sc = SMBUS_DEVICE_CLASS(klass);
- sc->init = smbus_eeprom_initfn;
+ dc->realize = smbus_eeprom_realize;
sc->quick_cmd = eeprom_quick_cmd;
sc->send_byte = eeprom_send_byte;
sc->receive_byte = eeprom_receive_byte;