qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH V2 07/10] SD card: introduce "if-idx" property f


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH V2 07/10] SD card: introduce "if-idx" property for SD card objects
Date: Wed, 11 Apr 2012 13:33:26 +0100

On 5 April 2012 16:48, Igor Mitsyanko <address@hidden> wrote:
> -#define SD_INIT(sd, bdrv, is_spi)   (SD_GET_CLASS(sd)->init(sd, bdrv, 
> is_spi))
> +#define SD_INIT(sd, bdrv, is_spi)   (SD_GET_CLASS(sd)->init(sd, is_spi))

> diff --git a/hw/ssi-sd.c b/hw/ssi-sd.c
> index beecc0e..38057ba 100644
> --- a/hw/ssi-sd.c
> +++ b/hw/ssi-sd.c
> @@ -236,11 +236,16 @@ static int ssi_sd_init(SSISlave *dev)
>  {
>     ssi_sd_state *s = FROM_SSI_SLAVE(ssi_sd_state, dev);
>     DriveInfo *dinfo;
> +    Error *errp = NULL;
>
>     s->mode = SSI_SD_CMD;
>     dinfo = drive_get_next(IF_SD);
>     s->sd = SD_CARD(object_new(TYPE_SD_CARD));
> -    SD_INIT(s->sd, dinfo ? dinfo->bdrv : NULL, true);
> +    if (dinfo) {
> +        object_property_set_int(OBJECT(s->sd), dinfo->unit, "if-idx", &errp);
> +    }
> +    assert_no_error(errp);
> +    SD_INIT(s->sd, true);

This doesn't compile:
/home/petmay01/linaro/qemu-from-laptop/qemu/hw/ssi-sd.c: In function
‘ssi_sd_init’:
/home/petmay01/linaro/qemu-from-laptop/qemu/hw/ssi-sd.c:248: error:
macro "SD_INIT" requires 3 arguments, but only 2 given

-- PMM



reply via email to

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