All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>, qemu-devel@nongnu.org
Cc: edgar.iglesias@gmail.com,
	Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Subject: Re: [Qemu-devel] [PATCH v2 16/21] timer/etraxfs_timer: Convert sysbus init function to realize function
Date: Fri, 23 Nov 2018 17:32:45 +0100	[thread overview]
Message-ID: <4e9d4cd2-042f-5431-8d89-f77464d0d119@redhat.com> (raw)
In-Reply-To: <20181123153040.18933-17-maozhongyi@cmss.chinamobile.com>

On 23/11/18 16:30, Mao Zhongyi wrote:
> Use DeviceClass rather than SysBusDeviceClass in
> etraxfs_timer_class_init().
> 
> Cc: edgar.iglesias@gmail.com
> 
> Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
> Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> ---
>  hw/timer/etraxfs_timer.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/hw/timer/etraxfs_timer.c b/hw/timer/etraxfs_timer.c
> index d13bc30b2d..2280914b1d 100644
> --- a/hw/timer/etraxfs_timer.c
> +++ b/hw/timer/etraxfs_timer.c
> @@ -315,9 +315,10 @@ static void etraxfs_timer_reset(void *opaque)
>      qemu_irq_lower(t->irq);
>  }
>  
> -static int etraxfs_timer_init(SysBusDevice *dev)
> +static void etraxfs_timer_realize(DeviceState *dev, Error **errp)
>  {
>      ETRAXTimerState *t = ETRAX_TIMER(dev);
> +    SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
>  
>      t->bh_t0 = qemu_bh_new(timer0_hit, t);
>      t->bh_t1 = qemu_bh_new(timer1_hit, t);
> @@ -326,21 +327,20 @@ static int etraxfs_timer_init(SysBusDevice *dev)
>      t->ptimer_t1 = ptimer_init(t->bh_t1, PTIMER_POLICY_DEFAULT);
>      t->ptimer_wd = ptimer_init(t->bh_wd, PTIMER_POLICY_DEFAULT);
>  
> -    sysbus_init_irq(dev, &t->irq);
> -    sysbus_init_irq(dev, &t->nmi);
> +    sysbus_init_irq(sbd, &t->irq);
> +    sysbus_init_irq(sbd, &t->nmi);
>  
>      memory_region_init_io(&t->mmio, OBJECT(t), &timer_ops, t,
>                            "etraxfs-timer", 0x5c);
> -    sysbus_init_mmio(dev, &t->mmio);
> +    sysbus_init_mmio(sbd, &t->mmio);
>      qemu_register_reset(etraxfs_timer_reset, t);
> -    return 0;
>  }
>  
>  static void etraxfs_timer_class_init(ObjectClass *klass, void *data)
>  {
> -    SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass);
> +    DeviceClass *dc = DEVICE_CLASS(klass);
>  
> -    sdc->init = etraxfs_timer_init;
> +    dc->realize = etraxfs_timer_realize;
>  }
>  
>  static const TypeInfo etraxfs_timer_info = {
> 

  reply	other threads:[~2018-11-23 16:32 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-23 15:30 [Qemu-devel] [PATCH v2 00/21] QOM'ify SysBusDeviceClass->init Mao Zhongyi
2018-11-23 15:30 ` Mao Zhongyi
2018-11-23 15:30 ` [Qemu-devel] [PATCH v2 01/21] musicpal: Convert sysbus init function to realize function Mao Zhongyi
2018-11-23 15:30 ` [Qemu-devel] [PATCH v2 02/21] block/noenand: " Mao Zhongyi
2018-11-23 16:31   ` Philippe Mathieu-Daudé
2018-11-23 15:30 ` [Qemu-devel] [PATCH v2 03/21] char/grlib_apbuart: " Mao Zhongyi
2018-11-23 15:38   ` Philippe Mathieu-Daudé
2018-11-23 15:30 ` [Qemu-devel] [PATCH v2 04/21] core/empty_slot: " Mao Zhongyi
2018-11-23 15:30 ` [Qemu-devel] [PATCH v2 05/21] display/g364fb: " Mao Zhongyi
2018-11-23 15:43   ` Philippe Mathieu-Daudé
2018-11-23 15:30 ` [Qemu-devel] [PATCH v2 06/21] dma/puv3_dma: " Mao Zhongyi
2018-11-23 15:30 ` [Qemu-devel] [PATCH v2 07/21] gpio/puv3_gpio: " Mao Zhongyi
2018-11-23 15:38   ` Philippe Mathieu-Daudé
2018-11-23 15:30 ` [Qemu-devel] [PATCH v2 08/21] milkymist-softusb: " Mao Zhongyi
2018-11-23 15:39   ` Philippe Mathieu-Daudé
2018-11-23 15:30 ` [Qemu-devel] [PATCH v2 09/21] input/pl050: " Mao Zhongyi
2018-11-23 15:40   ` Philippe Mathieu-Daudé
2018-11-23 15:30 ` [Qemu-devel] [PATCH v2 10/21] intc/puv3_intc: " Mao Zhongyi
2018-11-23 15:44   ` Philippe Mathieu-Daudé
2018-11-23 15:30 ` [Qemu-devel] [PATCH v2 11/21] milkymist-hpdmc: " Mao Zhongyi
2018-11-23 15:30 ` [Qemu-devel] [PATCH v2 12/21] milkymist-pfpu: " Mao Zhongyi
2018-11-23 15:40   ` Philippe Mathieu-Daudé
2018-11-23 15:30 ` [Qemu-devel] [PATCH v2 13/21] puv3_pm.c: " Mao Zhongyi
2018-11-23 15:30 ` [Qemu-devel] [PATCH v2 14/21] nvram/ds1225y: " Mao Zhongyi
2018-11-23 15:30 ` [Qemu-devel] [PATCH v2 15/21] pci-bridge/dec: " Mao Zhongyi
2018-11-23 16:37   ` Philippe Mathieu-Daudé
2018-11-25  1:36     ` [Qemu-devel] [PATCH v2 15/21] pci-bridge/dec: Convert sysbus initfunction " maozy
2018-11-23 15:30 ` [Qemu-devel] [PATCH v2 16/21] timer/etraxfs_timer: Convert sysbus init function " Mao Zhongyi
2018-11-23 16:32   ` Philippe Mathieu-Daudé [this message]
2018-11-23 16:33   ` Edgar E. Iglesias
2018-11-23 15:30 ` [Qemu-devel] [PATCH v2 17/21] timer/grlib_gptimer: " Mao Zhongyi
2018-11-23 15:41   ` Philippe Mathieu-Daudé
2018-11-23 15:30 ` [Qemu-devel] [PATCH v2 18/21] timer/puv3_ost: " Mao Zhongyi
2018-11-23 16:33   ` Philippe Mathieu-Daudé
2018-11-23 15:30 ` [Qemu-devel] [PATCH v2 19/21] usb/tusb6010: " Mao Zhongyi
2018-11-23 15:30 ` [Qemu-devel] [PATCH v2 20/21] xen_backend: remove xen_sysdev_init() function Mao Zhongyi
2018-11-23 15:30   ` Mao Zhongyi
2018-11-26 14:27   ` [Qemu-devel] " Anthony PERARD
2018-11-26 14:27     ` Anthony PERARD
2018-11-23 15:30 ` [Qemu-devel] [PATCH v2 21/21] core/sysbus: remove the SysBusDeviceClass::init path Mao Zhongyi

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=4e9d4cd2-042f-5431-8d89-f77464d0d119@redhat.com \
    --to=philmd@redhat.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=maozhongyi@cmss.chinamobile.com \
    --cc=qemu-devel@nongnu.org \
    --cc=zhangshengju@cmss.chinamobile.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.