[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 058/197] fixup type registration
From: |
Anthony Liguori |
Subject: |
[Qemu-devel] [PATCH v3 058/197] fixup type registration |
Date: |
Mon, 12 Dec 2011 14:18:54 -0600 |
---
hw/i2c.c | 9 +++++++--
hw/i2c.h | 1 +
hw/smbus.c | 2 +-
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/hw/i2c.c b/hw/i2c.c
index cdf88f2..fcb7269 100644
--- a/hw/i2c.c
+++ b/hw/i2c.c
@@ -177,12 +177,17 @@ static int i2c_slave_qdev_init(DeviceState *dev,
DeviceInfo *base)
return info->init(s);
}
-void i2c_register_slave(I2CSlaveInfo *info)
+void i2c_register_slave_subclass(I2CSlaveInfo *info, const char *parent)
{
assert(info->qdev.size >= sizeof(I2CSlave));
info->qdev.init = i2c_slave_qdev_init;
info->qdev.bus_info = &i2c_bus_info;
- qdev_register(&info->qdev);
+ qdev_register_subclass(&info->qdev, parent);
+}
+
+void i2c_register_slave(I2CSlaveInfo *info)
+{
+ i2c_register_slave_subclass(info, TYPE_I2C_SLAVE);
}
DeviceState *i2c_create_slave(i2c_bus *bus, const char *name, uint8_t addr)
diff --git a/hw/i2c.h b/hw/i2c.h
index cc4d76b..0c6f2ac 100644
--- a/hw/i2c.h
+++ b/hw/i2c.h
@@ -71,6 +71,7 @@ int i2c_recv(i2c_bus *bus);
#define FROM_I2C_SLAVE(type, dev) DO_UPCAST(type, i2c, dev)
void i2c_register_slave(I2CSlaveInfo *type);
+void i2c_register_slave_subclass(I2CSlaveInfo *info, const char *parent);
DeviceState *i2c_create_slave(i2c_bus *bus, const char *name, uint8_t addr);
diff --git a/hw/smbus.c b/hw/smbus.c
index a75d404..2711229 100644
--- a/hw/smbus.c
+++ b/hw/smbus.c
@@ -213,7 +213,7 @@ void smbus_register_device(SMBusDeviceInfo *info)
info->i2c.event = smbus_i2c_event;
info->i2c.recv = smbus_i2c_recv;
info->i2c.send = smbus_i2c_send;
- i2c_register_slave(&info->i2c);
+ i2c_register_slave_subclass(&info->i2c, TYPE_SMBUS_DEVICE);
}
/* Master device commands. */
--
1.7.4.1
- [Qemu-devel] [PATCH v3 045/197] usb: get rid of info pointer, (continued)
- [Qemu-devel] [PATCH v3 045/197] usb: get rid of info pointer, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 047/197] usb: use a factory instead of doing silly things for legacy, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 046/197] usb: promote all of the methods for USBDevice to class methods, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 049/197] usb-hid: simply class initialization a bit, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 051/197] drop info link in SCSIDeviceInfo, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 048/197] usb: kill USBDeviceInfo, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 052/197] move methods out of SCSIDeviceInfo into SCSIDeviceClass, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 054/197] get rid of CCIDCardInfo, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 056/197] add I2CSlave to the type hierarchy, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 055/197] rename i2c_slave -> I2CSlave, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 058/197] fixup type registration,
Anthony Liguori <=
- [Qemu-devel] [PATCH v3 059/197] kill off SMBusDeviceInfo, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 060/197] add guards, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 061/197] killall I2CSlaveInfo, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 064/197] killall VIOsPAPRDeviceInfo, Anthony Liguori, 2011/12/12
[Qemu-devel] [PATCH v3 065/197] qxl: be more patch monkey friendly, Anthony Liguori, 2011/12/12