qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Alistair Francis <alistair.francis@xilinx.com>, qemu-devel@nongnu.org
Cc: peter.crosthwaite@xilinx.com
Subject: Re: [Qemu-devel] [PATCH v3 1/1] char: cadence_uart: Convert to realize()
Date: Fri, 27 Feb 2015 18:59:56 +0100	[thread overview]
Message-ID: <54F0B09C.90105@suse.de> (raw)
In-Reply-To: <787a3b7f44a5be8b6976a808ca8e76cf84dc830e.1424999648.git.alistair.francis@xilinx.com>

Am 27.02.2015 um 02:48 schrieb Alistair Francis:
> Use the DeviceClass realize() and init() instead of
> the deprecated SysBusDevice init().
> 
> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>

Thanks, applied to qom-next with some wording/syntax changes and the
following QOM cast cleanup:

diff --git a/hw/char/cadence_uart.c b/hw/char/cadence_uart.c
index a713a08..36084d5 100644
--- a/hw/char/cadence_uart.c
+++ b/hw/char/cadence_uart.c
@@ -494,10 +494,11 @@ static void cadence_uart_realize(DeviceState *dev,
Error **errp)
 static void cadence_uart_init(Object *obj)
 {
     UartState *s = CADENCE_UART(obj);
+    SysBusDevice *sbd = SYS_BUS_DEVICE(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);
+    sysbus_init_mmio(sbd, &s->iomem);
+    sysbus_init_irq(sbd, &s->irq);

     s->char_tx_time = (get_ticks_per_sec() / 9600) * 10;
 }

fixing myself up with the canonical order:

diff --git a/hw/char/cadence_uart.c b/hw/char/cadence_uart.c
index 36084d5..a5dc2a4 100644
--- a/hw/char/cadence_uart.c
+++ b/hw/char/cadence_uart.c
@@ -493,8 +493,8 @@ static void cadence_uart_realize(DeviceState *dev,
Error **errp)

 static void cadence_uart_init(Object *obj)
 {
-    UartState *s = CADENCE_UART(obj);
     SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
+    UartState *s = CADENCE_UART(obj);

     memory_region_init_io(&s->iomem, obj, &uart_ops, s, "uart", 0x1000);
     sysbus_init_mmio(sbd, &s->iomem);

https://github.com/afaerber/qemu-cpu/commits/qom-next

Regards,
Andreas

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu,
Graham Norton; HRB 21284 (AG Nürnberg)

  reply	other threads:[~2015-02-27 18:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-27  1:48 [Qemu-devel] [PATCH v3 1/1] char: cadence_uart: Convert to realize() Alistair Francis
2015-02-27 17:59 ` Andreas Färber [this message]
2015-02-28  8:52   ` Alistair Francis
2015-03-16 23:19     ` Alistair Francis
2015-03-16 23:35       ` Andreas Färber
2015-03-16 23:45         ` Alistair Francis

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=54F0B09C.90105@suse.de \
    --to=afaerber@suse.de \
    --cc=alistair.francis@xilinx.com \
    --cc=peter.crosthwaite@xilinx.com \
    --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).