qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: xiaoqiang zhao <zxq_yx_007@163.com>, qemu-devel@nongnu.org
Cc: michael@walle.cc, kraxel@redhat.com, afaerber@suse.de
Subject: Re: [Qemu-devel] [PATCH 1/4] hw/audio: QOM'ify cs4231.c
Date: Wed, 16 Mar 2016 17:30:24 +0100	[thread overview]
Message-ID: <56E98A20.9050100@redhat.com> (raw)
In-Reply-To: <1458120244-30976-2-git-send-email-zxq_yx_007@163.com>



On 16/03/2016 10:24, xiaoqiang zhao wrote:
> Drop the old SysBus init function and use instance_init
> 
> Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com>
> ---
>  hw/audio/cs4231.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/hw/audio/cs4231.c b/hw/audio/cs4231.c
> index caf97c1..30690f9 100644
> --- a/hw/audio/cs4231.c
> +++ b/hw/audio/cs4231.c
> @@ -145,16 +145,15 @@ static const VMStateDescription vmstate_cs4231 = {
>      }
>  };
>  
> -static int cs4231_init1(SysBusDevice *dev)
> +static void cs4231_init(Object *obj)
>  {
> -    CSState *s = CS4231(dev);
> +    CSState *s = CS4231(obj);
> +    SysBusDevice *dev = SYS_BUS_DEVICE(obj);
>  
> -    memory_region_init_io(&s->iomem, OBJECT(s), &cs_mem_ops, s, "cs4321",
> +    memory_region_init_io(&s->iomem, obj, &cs_mem_ops, s, "cs4321",
>                            CS_SIZE);
>      sysbus_init_mmio(dev, &s->iomem);
>      sysbus_init_irq(dev, &s->irq);
> -
> -    return 0;
>  }
>  
>  static Property cs4231_properties[] = {
> @@ -164,9 +163,7 @@ static Property cs4231_properties[] = {
>  static void cs4231_class_init(ObjectClass *klass, void *data)
>  {
>      DeviceClass *dc = DEVICE_CLASS(klass);
> -    SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
>  
> -    k->init = cs4231_init1;
>      dc->reset = cs_reset;
>      dc->vmsd = &vmstate_cs4231;
>      dc->props = cs4231_properties;
> @@ -176,6 +173,7 @@ static const TypeInfo cs4231_info = {
>      .name          = TYPE_CS4231,
>      .parent        = TYPE_SYS_BUS_DEVICE,
>      .instance_size = sizeof(CSState),
> +    .instance_init = cs4231_init,
>      .class_init    = cs4231_class_init,
>  };
>  
> 

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

  reply	other threads:[~2016-03-16 16:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-16  9:24 [Qemu-devel] [PATCH 0/4] QOM'ify hw/audio files xiaoqiang zhao
2016-03-16  9:24 ` [Qemu-devel] [PATCH 1/4] hw/audio: QOM'ify cs4231.c xiaoqiang zhao
2016-03-16 16:30   ` Paolo Bonzini [this message]
2016-03-16  9:24 ` [Qemu-devel] [PATCH 2/4] hw/audio: QOM cleanup for intel-hda xiaoqiang zhao
2016-03-16  9:24 ` [Qemu-devel] [PATCH 3/4] hw/audio: QOM'ify intel-hda xiaoqiang zhao
2016-03-16  9:24 ` [Qemu-devel] [PATCH 4/4] hw/audio: QOM'ify milkymist-ac97.c xiaoqiang zhao
2016-03-16 16:30   ` Paolo Bonzini
2016-03-17  1:39     ` 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=56E98A20.9050100@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=afaerber@suse.de \
    --cc=kraxel@redhat.com \
    --cc=michael@walle.cc \
    --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).