aboutsummaryrefslogtreecommitdiff
path: root/hw/z2.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-12-04 20:39:20 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2012-01-27 10:50:47 -0600
commitb5ea932781954355a9880e2744722cd05cc496f9 (patch)
treef47482844578c1dffdae93dc3ec103a101097a71 /hw/z2.c
parent9e07bdf816b186632cda9651ac29bba76d299c03 (diff)
downloadqemu-b5ea932781954355a9880e2744722cd05cc496f9.zip
qemu-b5ea932781954355a9880e2744722cd05cc496f9.tar.gz
qemu-b5ea932781954355a9880e2744722cd05cc496f9.tar.bz2
i2c: smbus: convert to QEMU Object Model
This converts two types because smbus is implemented as a subclass of i2c. It's extremely difficult to convert these two independently. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/z2.c')
-rw-r--r--hw/z2.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/hw/z2.c b/hw/z2.c
index 2984a60..b12f974 100644
--- a/hw/z2.c
+++ b/hw/z2.c
@@ -273,14 +273,21 @@ static VMStateDescription vmstate_aer915_state = {
}
};
-static I2CSlaveInfo aer915_info = {
- .qdev.name = "aer915",
- .qdev.size = sizeof(AER915State),
- .qdev.vmsd = &vmstate_aer915_state,
- .init = aer915_init,
- .event = aer915_event,
- .recv = aer915_recv,
- .send = aer915_send
+static void aer915_class_init(ObjectClass *klass, void *data)
+{
+ I2CSlaveClass *k = I2C_SLAVE_CLASS(klass);
+
+ k->init = aer915_init;
+ k->event = aer915_event;
+ k->recv = aer915_recv;
+ k->send = aer915_send;
+}
+
+static DeviceInfo aer915_info = {
+ .name = "aer915",
+ .size = sizeof(AER915State),
+ .vmsd = &vmstate_aer915_state,
+ .class_init = aer915_class_init,
};
static void z2_init(ram_addr_t ram_size,