[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 48/53] hw/i2c/smbus: Use DeviceClass::realize instead
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 48/53] hw/i2c/smbus: Use DeviceClass::realize instead of SMBusDeviceClass::init |
Date: |
Thu, 31 May 2018 19:16:01 +0200 |
From: Philippe Mathieu-Daudé <address@hidden>
SMBusDeviceClass::init is no more used, remove it.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/i2c/smbus.c | 9 ---------
hw/i2c/smbus_eeprom.c | 5 ++---
include/hw/i2c/smbus.h | 1 -
3 files changed, 2 insertions(+), 13 deletions(-)
diff --git a/hw/i2c/smbus.c b/hw/i2c/smbus.c
index 2d1b79a689..587ce1ab7f 100644
--- a/hw/i2c/smbus.c
+++ b/hw/i2c/smbus.c
@@ -202,14 +202,6 @@ static int smbus_i2c_send(I2CSlave *s, uint8_t data)
return 0;
}
-static int smbus_device_init(I2CSlave *i2c)
-{
- SMBusDevice *dev = SMBUS_DEVICE(i2c);
- SMBusDeviceClass *sc = SMBUS_DEVICE_GET_CLASS(dev);
-
- return sc->init(dev);
-}
-
/* Master device commands. */
int smbus_quick_command(I2CBus *bus, uint8_t addr, int read)
{
@@ -350,7 +342,6 @@ static void smbus_device_class_init(ObjectClass *klass,
void *data)
{
I2CSlaveClass *sc = I2C_SLAVE_CLASS(klass);
- sc->init = smbus_device_init;
sc->event = smbus_i2c_event;
sc->recv = smbus_i2c_recv;
sc->send = smbus_i2c_send;
diff --git a/hw/i2c/smbus_eeprom.c b/hw/i2c/smbus_eeprom.c
index b13ec0fe7a..125c887d1f 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;
diff --git a/include/hw/i2c/smbus.h b/include/hw/i2c/smbus.h
index 544bbc1957..cfe3fa69f3 100644
--- a/include/hw/i2c/smbus.h
+++ b/include/hw/i2c/smbus.h
@@ -38,7 +38,6 @@
typedef struct SMBusDeviceClass
{
I2CSlaveClass parent_class;
- int (*init)(SMBusDevice *dev);
void (*quick_cmd)(SMBusDevice *dev, uint8_t read);
void (*send_byte)(SMBusDevice *dev, uint8_t val);
uint8_t (*receive_byte)(SMBusDevice *dev);
--
2.17.0
- [Qemu-devel] [PULL 37/53] tcg: remove softfloat from --disable-tcg builds, (continued)
- [Qemu-devel] [PULL 37/53] tcg: remove softfloat from --disable-tcg builds, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 34/53] WHPX: dynamically load WHP libraries, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 39/53] ipmi: Use proper struct reference for KCS vmstate, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 43/53] scripts/update-linux-headers: Handle __aligned_u64, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 41/53] gdbstub: Prevent fd leakage, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 45/53] target/i386/kvm.c: Handle renaming of KVM_HINTS_DEDICATED, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 40/53] docs/interop: add "firmware.json", Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 44/53] scripts/update-linux-headers: Handle kernel license no longer being one file, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 47/53] target/i386/kvm.c: Remove compatibility shim for KVM_HINTS_REALTIME, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 42/53] virtio-gpu-3d: Define VIRTIO_GPU_CAPSET_VIRGL2 elsewhere, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 48/53] hw/i2c/smbus: Use DeviceClass::realize instead of SMBusDeviceClass::init,
Paolo Bonzini <=
- [Qemu-devel] [PULL 52/53] char: Remove unwanted crlf conversion, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 51/53] qdev: Remove DeviceClass::init() and ::exit(), Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 53/53] memory: Make operations using MemoryRegionIoeventfd struct pass by pointer., Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 49/53] hw/i2c: Use DeviceClass::realize instead of I2CSlaveClass::init, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 50/53] qdev: Simplify the SysBusDeviceClass::init path, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 46/53] Update Linux headers to 4.17-rc6, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 37/53] tcg: remove softfloat from --disable-tcg builds, Paolo Bonzini, 2018/05/31
- Re: [Qemu-devel] [PULL 00/53] Misc patches for 2018-05-31, Peter Maydell, 2018/05/31