From: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
To: Alistair Francis <alistair.francis@xilinx.com>,
Peter Maydell <peter.maydell@linaro.org>
Cc: "qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH v1 1/1] char: cadence_uart: Convert to realize()
Date: Fri, 27 Jun 2014 10:11:33 +1000 [thread overview]
Message-ID: <CAEgOgz6m0pqeynnB8MNzgNzMGFGhpTGkB+M2asknBYhgYRrpqw@mail.gmail.com> (raw)
In-Reply-To: <22b9e550138022caa0368f12c12c55f1675420a5.1403588925.git.alistair.francis@xilinx.com>
On Tue, Jun 24, 2014 at 4:06 PM, Alistair Francis
<alistair.francis@xilinx.com> wrote:
> SysBusDevice::init is deprecated. Convert to Object::init and
> Device::realize as prescribed by QOM conventions.
>
> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
CC Peter for target-arm.
Regards,
Peter
> ---
>
> hw/char/cadence_uart.c | 29 ++++++++++++++++-------------
> 1 files changed, 16 insertions(+), 13 deletions(-)
>
> diff --git a/hw/char/cadence_uart.c b/hw/char/cadence_uart.c
> index bf0c853..5a22a72 100644
> --- a/hw/char/cadence_uart.c
> +++ b/hw/char/cadence_uart.c
> @@ -468,27 +468,30 @@ static void cadence_uart_reset(DeviceState *dev)
> uart_update_status(s);
> }
>
> -static int cadence_uart_init(SysBusDevice *dev)
> +static void candence_uart_realize(DeviceState *dev, Error **errp)
> {
> UartState *s = CADENCE_UART(dev);
>
> - memory_region_init_io(&s->iomem, OBJECT(s), &uart_ops, s, "uart", 0x1000);
> - sysbus_init_mmio(dev, &s->iomem);
> - sysbus_init_irq(dev, &s->irq);
> -
> - s->fifo_trigger_handle = timer_new_ns(QEMU_CLOCK_VIRTUAL,
> - (QEMUTimerCB *)fifo_trigger_update, s);
> -
> - s->char_tx_time = (get_ticks_per_sec() / 9600) * 10;
> -
> s->chr = qemu_char_get_next_serial();
>
> if (s->chr) {
> qemu_chr_add_handlers(s->chr, uart_can_receive, uart_receive,
> uart_event, s);
> }
> +}
>
> - return 0;
> +static void cadence_uart_init(Object *obj)
> +{
> + UartState *s = CADENCE_UART(obj);
> +
> + memory_region_init_io(&s->iomem, obj, &uart_ops, s, "uart", 0x1000);
> + sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->iomem);
> + sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->irq);
> +
> + s->fifo_trigger_handle = timer_new_ns(QEMU_CLOCK_VIRTUAL,
> + (QEMUTimerCB *)fifo_trigger_update, s);
> +
> + s->char_tx_time = (get_ticks_per_sec() / 9600) * 10;
> }
>
> static int cadence_uart_post_load(void *opaque, int version_id)
> @@ -520,9 +523,8 @@ static const VMStateDescription vmstate_cadence_uart = {
> static void cadence_uart_class_init(ObjectClass *klass, void *data)
> {
> DeviceClass *dc = DEVICE_CLASS(klass);
> - SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass);
>
> - sdc->init = cadence_uart_init;
> + dc->realize = candence_uart_realize;
> dc->vmsd = &vmstate_cadence_uart;
> dc->reset = cadence_uart_reset;
> }
> @@ -531,6 +533,7 @@ static const TypeInfo cadence_uart_info = {
> .name = TYPE_CADENCE_UART,
> .parent = TYPE_SYS_BUS_DEVICE,
> .instance_size = sizeof(UartState),
> + .instance_init = cadence_uart_init,
> .class_init = cadence_uart_class_init,
> };
>
> --
> 1.7.1
>
>
next prev parent reply other threads:[~2014-06-27 0:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-24 6:06 [Qemu-devel] [PATCH v1 1/1] char: cadence_uart: Convert to realize() Alistair Francis
2014-06-27 0:11 ` Peter Crosthwaite [this message]
2014-06-27 10:23 ` Peter Maydell
2014-07-03 16:46 ` Peter Maydell
2014-07-03 16:59 ` Andreas Färber
2014-07-03 23:17 ` Peter Crosthwaite
2015-01-05 22:28 ` Alistair Francis
2014-07-04 6:50 ` Alexander Graf
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=CAEgOgz6m0pqeynnB8MNzgNzMGFGhpTGkB+M2asknBYhgYRrpqw@mail.gmail.com \
--to=peter.crosthwaite@xilinx.com \
--cc=afaerber@suse.de \
--cc=alistair.francis@xilinx.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).