qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH qom-next for-1.6 04/29] integratorcp: QOM'ify ic


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH qom-next for-1.6 04/29] integratorcp: QOM'ify icp_pic_state
Date: Sat, 27 Jul 2013 16:04:40 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7

Am 24.07.2013 09:47, schrieb Andreas Färber:
> diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c
> index 58f4ed7..af31007 100644
> --- a/hw/arm/integratorcp.c
> +++ b/hw/arm/integratorcp.c
[...]
> @@ -376,7 +382,7 @@ static const MemoryRegionOps icp_pic_ops = {
>  
>  static int icp_pic_init(SysBusDevice *dev)
>  {
> -    icp_pic_state *s = FROM_SYSBUS(icp_pic_state, dev);
> +    icp_pic_state *s = INTEGRATOR_PIC(dev);
>  
>      qdev_init_gpio_in(&dev->qdev, icp_pic_set_irq, 32);
>      sysbus_init_irq(dev, &s->parent_irq);
[snip]

Needs the following addition for ->qdev.

Andreas

diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c
index af31007..d518188 100644
--- a/hw/arm/integratorcp.c
+++ b/hw/arm/integratorcp.c
@@ -380,16 +380,17 @@ static const MemoryRegionOps icp_pic_ops = {
     .endianness = DEVICE_NATIVE_ENDIAN,
 };

-static int icp_pic_init(SysBusDevice *dev)
+static int icp_pic_init(SysBusDevice *sbd)
 {
+    DeviceState *dev = DEVICE(sbd);
     icp_pic_state *s = INTEGRATOR_PIC(dev);

-    qdev_init_gpio_in(&dev->qdev, icp_pic_set_irq, 32);
-    sysbus_init_irq(dev, &s->parent_irq);
-    sysbus_init_irq(dev, &s->parent_fiq);
+    qdev_init_gpio_in(dev, icp_pic_set_irq, 32);
+    sysbus_init_irq(sbd, &s->parent_irq);
+    sysbus_init_irq(sbd, &s->parent_fiq);
     memory_region_init_io(&s->iomem, OBJECT(s), &icp_pic_ops, s,
                           "icp-pic", 0x00800000);
-    sysbus_init_mmio(dev, &s->iomem);
+    sysbus_init_mmio(sbd, &s->iomem);
     return 0;
 }



-- 
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]