[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 17/21] timer/grlib_gptimer: Convert sysbus in
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-devel] [PATCH v2 17/21] timer/grlib_gptimer: Convert sysbus init function to realize function |
Date: |
Fri, 23 Nov 2018 16:41:18 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 |
On 23/11/18 16:30, Mao Zhongyi wrote:
> Use DeviceClass rather than SysBusDeviceClass in
> grlib_gptimer_class_init().
>
> Cc: address@hidden
>
> Signed-off-by: Mao Zhongyi <address@hidden>
> Signed-off-by: Zhang Shengju <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> hw/timer/grlib_gptimer.c | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/hw/timer/grlib_gptimer.c b/hw/timer/grlib_gptimer.c
> index 4ed96e970a..183eddc073 100644
> --- a/hw/timer/grlib_gptimer.c
> +++ b/hw/timer/grlib_gptimer.c
> @@ -347,10 +347,11 @@ static void grlib_gptimer_reset(DeviceState *d)
> }
> }
>
> -static int grlib_gptimer_init(SysBusDevice *dev)
> +static void grlib_gptimer_realize(DeviceState *dev, Error **errp)
> {
> GPTimerUnit *unit = GRLIB_GPTIMER(dev);
> unsigned int i;
> + SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
>
> assert(unit->nr_timers > 0);
> assert(unit->nr_timers <= GPTIMER_MAX_TIMERS);
> @@ -366,7 +367,7 @@ static int grlib_gptimer_init(SysBusDevice *dev)
> timer->id = i;
>
> /* One IRQ line for each timer */
> - sysbus_init_irq(dev, &timer->irq);
> + sysbus_init_irq(sbd, &timer->irq);
>
> ptimer_set_freq(timer->ptimer, unit->freq_hz);
> }
> @@ -375,8 +376,7 @@ static int grlib_gptimer_init(SysBusDevice *dev)
> unit, "gptimer",
> UNIT_REG_SIZE + GPTIMER_REG_SIZE *
> unit->nr_timers);
>
> - sysbus_init_mmio(dev, &unit->iomem);
> - return 0;
> + sysbus_init_mmio(sbd, &unit->iomem);
> }
>
> static Property grlib_gptimer_properties[] = {
> @@ -389,9 +389,8 @@ static Property grlib_gptimer_properties[] = {
> static void grlib_gptimer_class_init(ObjectClass *klass, void *data)
> {
> DeviceClass *dc = DEVICE_CLASS(klass);
> - SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
>
> - k->init = grlib_gptimer_init;
> + dc->realize = grlib_gptimer_realize;
> dc->reset = grlib_gptimer_reset;
> dc->props = grlib_gptimer_properties;
> }
>
- [Qemu-devel] [PATCH v2 14/21] nvram/ds1225y: Convert sysbus init function to realize function, (continued)
- [Qemu-devel] [PATCH v2 14/21] nvram/ds1225y: Convert sysbus init function to realize function, Mao Zhongyi, 2018/11/23
- [Qemu-devel] [PATCH v2 16/21] timer/etraxfs_timer: Convert sysbus init function to realize function, Mao Zhongyi, 2018/11/23
- [Qemu-devel] [PATCH v2 05/21] display/g364fb: Convert sysbus init function to realize function, Mao Zhongyi, 2018/11/23
- [Qemu-devel] [PATCH v2 19/21] usb/tusb6010: Convert sysbus init function to realize function, Mao Zhongyi, 2018/11/23
- [Qemu-devel] [PATCH v2 10/21] intc/puv3_intc: Convert sysbus init function to realize function, Mao Zhongyi, 2018/11/23
- [Qemu-devel] [PATCH v2 17/21] timer/grlib_gptimer: Convert sysbus init function to realize function, Mao Zhongyi, 2018/11/23
- Re: [Qemu-devel] [PATCH v2 17/21] timer/grlib_gptimer: Convert sysbus init function to realize function,
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH v2 13/21] puv3_pm.c: Convert sysbus init function to realize function, Mao Zhongyi, 2018/11/23
- [Qemu-devel] [PATCH v2 02/21] block/noenand: Convert sysbus init function to realize function, Mao Zhongyi, 2018/11/23
- [Qemu-devel] [PATCH v2 15/21] pci-bridge/dec: Convert sysbus init function to realize function, Mao Zhongyi, 2018/11/23
- [Qemu-devel] [PATCH v2 18/21] timer/puv3_ost: Convert sysbus init function to realize function, Mao Zhongyi, 2018/11/23
- [Qemu-devel] [PATCH v2 20/21] xen_backend: remove xen_sysdev_init() function, Mao Zhongyi, 2018/11/23