qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: xiaoqiang zhao <zxq_yx_007@163.com>
Cc: qemu-devel@nongnu.org, i.mitsyanko@gmail.com,
	chouteau@adacore.com, peter.chubb@nicta.com.au, michael@walle.cc,
	peter.maydell@linaro.org, blauwirbel@gmail.com
Subject: Re: [Qemu-devel] [PATCH v1 1/9] hw/intc: QOM'ify etraxfs_pic.c
Date: Thu, 5 May 2016 16:24:36 +0200	[thread overview]
Message-ID: <20160505142436.GA16305@toto> (raw)
In-Reply-To: <1462444132-18541-2-git-send-email-zxq_yx_007@163.com>

On Thu, May 05, 2016 at 06:28:48PM +0800, xiaoqiang zhao wrote:
> Drop the old SysBus init function and use instance_init
> 
> Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com>

Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>


> ---
>  hw/intc/etraxfs_pic.c | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/hw/intc/etraxfs_pic.c b/hw/intc/etraxfs_pic.c
> index 48f9477..64a6f4b 100644
> --- a/hw/intc/etraxfs_pic.c
> +++ b/hw/intc/etraxfs_pic.c
> @@ -146,19 +146,19 @@ static void irq_handler(void *opaque, int irq, int level)
>      pic_update(fs);
>  }
>  
> -static int etraxfs_pic_init(SysBusDevice *sbd)
> +static void etraxfs_pic_init(Object *obj)
>  {
> -    DeviceState *dev = DEVICE(sbd);
> -    struct etrax_pic *s = ETRAX_FS_PIC(dev);
> +    DeviceState *dev = DEVICE(obj);
> +    struct etrax_pic *s = ETRAX_FS_PIC(obj);
> +    SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
>  
>      qdev_init_gpio_in(dev, irq_handler, 32);
>      sysbus_init_irq(sbd, &s->parent_irq);
>      sysbus_init_irq(sbd, &s->parent_nmi);
>  
> -    memory_region_init_io(&s->mmio, OBJECT(s), &pic_ops, s,
> +    memory_region_init_io(&s->mmio, obj, &pic_ops, s,
>                            "etraxfs-pic", R_MAX * 4);
>      sysbus_init_mmio(sbd, &s->mmio);
> -    return 0;
>  }
>  
>  static Property etraxfs_pic_properties[] = {
> @@ -169,9 +169,7 @@ static Property etraxfs_pic_properties[] = {
>  static void etraxfs_pic_class_init(ObjectClass *klass, void *data)
>  {
>      DeviceClass *dc = DEVICE_CLASS(klass);
> -    SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
>  
> -    k->init = etraxfs_pic_init;
>      dc->props = etraxfs_pic_properties;
>      /*
>       * Note: pointer property "interrupt_vector" may remain null, thus
> @@ -183,6 +181,7 @@ static const TypeInfo etraxfs_pic_info = {
>      .name          = TYPE_ETRAX_FS_PIC,
>      .parent        = TYPE_SYS_BUS_DEVICE,
>      .instance_size = sizeof(struct etrax_pic),
> +    .instance_init = etraxfs_pic_init,
>      .class_init    = etraxfs_pic_class_init,
>  };
>  
> -- 
> 2.1.4
> 
> 

  reply	other threads:[~2016-05-05 14:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-05 10:28 [Qemu-devel] [PATCH v1 0/9] QOM'ify hw/intc files xiaoqiang zhao
2016-05-05 10:28 ` [Qemu-devel] [PATCH v1 1/9] hw/intc: QOM'ify etraxfs_pic.c xiaoqiang zhao
2016-05-05 14:24   ` Edgar E. Iglesias [this message]
2016-05-05 10:28 ` [Qemu-devel] [PATCH v1 2/9] hw/intc: QOM'ify exynos4210_combiner.c xiaoqiang zhao
2016-05-05 10:28 ` [Qemu-devel] [PATCH v1 3/9] hw/intc: QOM'ify exynos4210_gic.c xiaoqiang zhao
2016-05-05 10:28 ` [Qemu-devel] [PATCH v1 4/9] hw/intc: QOM'ify imx_avic.c xiaoqiang zhao
2016-05-05 10:28 ` [Qemu-devel] [PATCH v1 5/9] hw/intc: QOM'ify lm32_pic.c xiaoqiang zhao
2016-05-05 10:39 ` [Qemu-devel] [PATCH v1 0/9] QOM'ify hw/intc files Peter Maydell
2016-05-05 10:41   ` 赵小强
2016-05-05 10:46     ` Peter Maydell
2016-05-05 10:48       ` xiaoqiang zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160505142436.GA16305@toto \
    --to=edgar.iglesias@gmail.com \
    --cc=blauwirbel@gmail.com \
    --cc=chouteau@adacore.com \
    --cc=i.mitsyanko@gmail.com \
    --cc=michael@walle.cc \
    --cc=peter.chubb@nicta.com.au \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=zxq_yx_007@163.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).