Am 31.01.2014 15:34, schrieb Andreas Färber: > Replace usages of FROM_I2C_SLAVE() with QOM cast macro and rename parent > field to assure we caught all. > > Signed-off-by: Andreas Färber <afaer...@suse.de> > --- > hw/arm/pxa2xx.c | 38 +++++++++++++++++++++++++------------- > 1 file changed, 25 insertions(+), 13 deletions(-) > > diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c > index daf60e8..e5f1e10 100644 > --- a/hw/arm/pxa2xx.c > +++ b/hw/arm/pxa2xx.c [...] > @@ -1496,8 +1508,8 @@ PXA2xxI2CState *pxa2xx_i2c_init(hwaddr base, > s = PXA2XX_I2C(i2c_dev); > /* FIXME: Should the slave device really be on a separate bus? */ > i2cbus = i2c_init_bus(dev, "dummy"); > - dev = i2c_create_slave(i2cbus, "pxa2xx-i2c-slave", 0); > - s->slave = FROM_I2C_SLAVE(PXA2xxI2CSlaveState, I2C_SLAVE(dev)); > + dev = i2c_create_slave(i2cbus, TYPE_PXA2XX_I2C_SLAVE, 0); > + s->slave = PXA2XX_I2C_SLAVE(dev); > s->slave->host = s; > > return s;
In line with Peter C.'s other comments, I've added mention that I'm reusing the type constant here. Will go through others to do the same. Andreas -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg