From 8aae84a1f2ad256d222c97411af17013b1c35799 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Fri, 25 Jan 2013 09:12:54 +0100 Subject: i2c: Drop I2C_SLAVE_FROM_QDEV() macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is not being used in hot paths and is obsoleted by I2C_SLAVE() QOM cast macro. Clean it up using a scripted conversion, so that it doesn't get used in new code. Some of its callers were combining it with FROM_I2C_SLAVE() macro, which is equally obsolete but needs to be replaced in a type-specific way. Signed-off-by: Andreas Färber Cc: Kuo-Jung Su Signed-off-by: Anthony Liguori --- hw/i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hw/i2c.c') diff --git a/hw/i2c.c b/hw/i2c.c index 119e96bc0e..ec314a40d1 100644 --- a/hw/i2c.c +++ b/hw/i2c.c @@ -92,7 +92,7 @@ int i2c_start_transfer(i2c_bus *bus, uint8_t address, int recv) QTAILQ_FOREACH(kid, &bus->qbus.children, sibling) { DeviceState *qdev = kid->child; - I2CSlave *candidate = I2C_SLAVE_FROM_QDEV(qdev); + I2CSlave *candidate = I2C_SLAVE(qdev); if (candidate->address == address) { slave = candidate; break; @@ -204,7 +204,7 @@ const VMStateDescription vmstate_i2c_slave = { static int i2c_slave_qdev_init(DeviceState *dev) { - I2CSlave *s = I2C_SLAVE_FROM_QDEV(dev); + I2CSlave *s = I2C_SLAVE(dev); I2CSlaveClass *sc = I2C_SLAVE_GET_CLASS(s); return sc->init(s); -- cgit v1.2.3