Patchwork [v2,1/2] hw/sm501: Use correct setter for sysbus-ohci dma-address property

login
register
mail settings
Submitter Peter Maydell
Date April 9, 2013, 11:27 a.m.
Message ID <1365506873-21324-2-git-send-email-peter.maydell@linaro.org>
Download mbox | patch
Permalink /patch/235051/
State New
Headers show

Comments

Peter Maydell - April 9, 2013, 11:27 a.m.
The sysbus-ohci dma-address property is declared as a HEX64
property, not a TADDR, so use the correct setter for it.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/display/sm501.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Andreas Färber - April 16, 2013, 2:47 p.m.
Am 09.04.2013 13:27, schrieb Peter Maydell:
> The sysbus-ohci dma-address property is declared as a HEX64
> property, not a TADDR, so use the correct setter for it.

Actually, it's declared as
DEFINE_PROP_DMAADDR("dma-offset", OHCISysBusState, dma_offset, 3),
which is in turn defined as DEFINE_PROP_HEX64 in include/hw/qdev-dma.h.

> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  hw/display/sm501.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/display/sm501.c b/hw/display/sm501.c
> index 6b660ac..3840bce 100644
> --- a/hw/display/sm501.c
> +++ b/hw/display/sm501.c
> @@ -1430,7 +1430,7 @@ void sm501_init(MemoryRegion *address_space_mem, uint32_t base,
>      /* bridge to usb host emulation module */
>      dev = qdev_create(NULL, "sysbus-ohci");
>      qdev_prop_set_uint32(dev, "num-ports", 2);
> -    qdev_prop_set_taddr(dev, "dma-offset", base);
> +    qdev_prop_set_uint64(dev, "dma-offset", base);
>      qdev_init_nofail(dev);
>      sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0,
>                      base + MMIO_BASE_OFFSET + SM501_USB_HOST);

You could also remove the include now, right?

Either way,

Acked-by: Andreas Färber <afaerber@suse.de>

CC'ing Gerd.

Andreas
Peter Maydell - April 16, 2013, 2:49 p.m.
On 16 April 2013 15:47, Andreas Färber <afaerber@suse.de> wrote:
> Am 09.04.2013 13:27, schrieb Peter Maydell:
>> The sysbus-ohci dma-address property is declared as a HEX64
>> property, not a TADDR, so use the correct setter for it.
>
> Actually, it's declared as
> DEFINE_PROP_DMAADDR("dma-offset", OHCISysBusState, dma_offset, 3),
> which is in turn defined as DEFINE_PROP_HEX64 in include/hw/qdev-dma.h.

Yes, I abbreviated a bit.

> You could also remove the include now, right?

In theory, but given patch 2 it's a bit moot :-)

> Either way,
>
> Acked-by: Andreas Färber <afaerber@suse.de>

Thanks.

-- PMM
Aurelien Jarno - April 16, 2013, 3:10 p.m.
On Tue, Apr 09, 2013 at 12:27:52PM +0100, Peter Maydell wrote:
> The sysbus-ohci dma-address property is declared as a HEX64
> property, not a TADDR, so use the correct setter for it.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  hw/display/sm501.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/display/sm501.c b/hw/display/sm501.c
> index 6b660ac..3840bce 100644
> --- a/hw/display/sm501.c
> +++ b/hw/display/sm501.c
> @@ -1430,7 +1430,7 @@ void sm501_init(MemoryRegion *address_space_mem, uint32_t base,
>      /* bridge to usb host emulation module */
>      dev = qdev_create(NULL, "sysbus-ohci");
>      qdev_prop_set_uint32(dev, "num-ports", 2);
> -    qdev_prop_set_taddr(dev, "dma-offset", base);
> +    qdev_prop_set_uint64(dev, "dma-offset", base);
>      qdev_init_nofail(dev);
>      sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0,
>                      base + MMIO_BASE_OFFSET + SM501_USB_HOST);

Tested-by: Aurelien Jarno <aurelien@aurel32.net>

Patch

diff --git a/hw/display/sm501.c b/hw/display/sm501.c
index 6b660ac..3840bce 100644
--- a/hw/display/sm501.c
+++ b/hw/display/sm501.c
@@ -1430,7 +1430,7 @@  void sm501_init(MemoryRegion *address_space_mem, uint32_t base,
     /* bridge to usb host emulation module */
     dev = qdev_create(NULL, "sysbus-ohci");
     qdev_prop_set_uint32(dev, "num-ports", 2);
-    qdev_prop_set_taddr(dev, "dma-offset", base);
+    qdev_prop_set_uint64(dev, "dma-offset", base);
     qdev_init_nofail(dev);
     sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0,
                     base + MMIO_BASE_OFFSET + SM501_USB_HOST);