From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 7/7] qdev/prop: convert eccmemctl
Date: Mon, 13 Jul 2009 15:13:10 +0200 [thread overview]
Message-ID: <1247490790-15783-8-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1247490790-15783-1-git-send-email-kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/eccmemctl.c | 21 ++++++++++++++++++---
1 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/hw/eccmemctl.c b/hw/eccmemctl.c
index d05962b..c5d6449 100644
--- a/hw/eccmemctl.c
+++ b/hw/eccmemctl.c
@@ -321,7 +321,6 @@ static void ecc_init1(SysBusDevice *dev)
ECCState *s = FROM_SYSBUS(ECCState, dev);
sysbus_init_irq(dev, &s->irq);
- s->version = qdev_get_prop_int(&dev->qdev, "version", -1);
s->regs[0] = s->version;
ecc_io_memory = cpu_register_io_memory(ecc_mem_read, ecc_mem_write, s);
sysbus_init_mmio(dev, ECC_SIZE, ecc_io_memory);
@@ -342,7 +341,7 @@ void ecc_init(target_phys_addr_t base, qemu_irq irq, uint32_t version)
SysBusDevice *s;
dev = qdev_create(NULL, "eccmemctl");
- qdev_set_prop_int(dev, "version", version);
+ qdev_prop_set_uint32(dev, "version", version);
qdev_init(dev);
s = sysbus_from_qdev(dev);
sysbus_connect_irq(s, 0, irq);
@@ -352,9 +351,25 @@ void ecc_init(target_phys_addr_t base, qemu_irq irq, uint32_t version)
}
}
+static SysBusDeviceInfo ecc_info = {
+ .init = ecc_init1,
+ .qdev.name = "eccmemctl",
+ .qdev.size = sizeof(ECCState),
+ .qdev.props = (Property[]) {
+ {
+ .name = "version",
+ .info = &qdev_prop_uint32,
+ .offset = offsetof(ECCState, version),
+ .defval = (uint32_t[]) { -1 },
+ },
+ {/* end of list */}
+ }
+};
+
+
static void ecc_register_devices(void)
{
- sysbus_register_dev("eccmemctl", sizeof(ECCState), ecc_init1);
+ sysbus_register_withprop(&ecc_info);
}
device_init(ecc_register_devices)
--
1.6.2.5
next prev parent reply other threads:[~2009-07-13 13:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-13 13:13 [Qemu-devel] [PATCH v2 0/7] qdev: property fixups Gerd Hoffmann
2009-07-13 13:13 ` [Qemu-devel] [PATCH 1/7] qdev/prop: make uint32 accept both hex and decimal Gerd Hoffmann
2009-07-13 13:13 ` [Qemu-devel] [PATCH 2/7] qdev/prop: add 16bit integer type Gerd Hoffmann
2009-07-13 13:13 ` [Qemu-devel] [PATCH 3/7] qdev/prop: unstatic and rename prop_ptr() Gerd Hoffmann
2009-07-13 13:13 ` [Qemu-devel] [PATCH 4/7] qdev/prop: add property for target_phys_addr_t Gerd Hoffmann
2009-07-13 13:13 ` [Qemu-devel] [PATCH 5/7] qdev/prop: convert m48t59 Gerd Hoffmann
2009-07-13 13:13 ` [Qemu-devel] [PATCH 6/7] qdev/prop: convert tcx Gerd Hoffmann
2009-07-13 13:13 ` Gerd Hoffmann [this message]
2009-07-13 15:02 ` [Qemu-devel] [PATCH v2 0/7] qdev: property fixups Blue Swirl
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=1247490790-15783-8-git-send-email-kraxel@redhat.com \
--to=kraxel@redhat.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).