From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34536) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCTw8-0001D4-T5 for qemu-devel@nongnu.org; Sun, 09 Feb 2014 07:56:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WCTw2-0004B9-Tf for qemu-devel@nongnu.org; Sun, 09 Feb 2014 07:56:40 -0500 Received: from cantor2.suse.de ([195.135.220.15]:52829 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCTw2-0004B4-N9 for qemu-devel@nongnu.org; Sun, 09 Feb 2014 07:56:34 -0500 Message-ID: <52F77AFE.2030705@suse.de> Date: Sun, 09 Feb 2014 13:56:30 +0100 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1391178886-17277-1-git-send-email-afaerber@suse.de> <1391178886-17277-3-git-send-email-afaerber@suse.de> In-Reply-To: <1391178886-17277-3-git-send-email-afaerber@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 02/11] pxa2xx: QOM'ify I2C slave List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Peter Crosthwaite Am 31.01.2014 15:34, schrieb Andreas F=C3=A4rber: > Replace usages of FROM_I2C_SLAVE() with QOM cast macro and rename paren= t > field to assure we caught all. >=20 > Signed-off-by: Andreas F=C3=A4rber > --- > hw/arm/pxa2xx.c | 38 +++++++++++++++++++++++++------------- > 1 file changed, 25 insertions(+), 13 deletions(-) >=20 > 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 =3D PXA2XX_I2C(i2c_dev); > /* FIXME: Should the slave device really be on a separate bus? */ > i2cbus =3D i2c_init_bus(dev, "dummy"); > - dev =3D i2c_create_slave(i2cbus, "pxa2xx-i2c-slave", 0); > - s->slave =3D FROM_I2C_SLAVE(PXA2xxI2CSlaveState, I2C_SLAVE(dev)); > + dev =3D i2c_create_slave(i2cbus, TYPE_PXA2XX_I2C_SLAVE, 0); > + s->slave =3D PXA2XX_I2C_SLAVE(dev); > s->slave->host =3D s; > =20 > 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 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg