qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 02/11] pxa2xx: QOM'ify I2C slave


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH 02/11] pxa2xx: QOM'ify I2C slave
Date: Sun, 09 Feb 2014 13:56:30 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

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 <address@hidden>
> ---
>  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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]