From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org
Cc: "Guan Xuetao" <gxt@mprc.pku.edu.cn>, "Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [PATCH qom-next for-1.6 5/6] puv3_gpio: QOM cast cleanup
Date: Fri, 26 Jul 2013 17:56:17 +0200 [thread overview]
Message-ID: <1374854178-12445-6-git-send-email-afaerber@suse.de> (raw)
In-Reply-To: <1374854178-12445-1-git-send-email-afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/gpio/puv3_gpio.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/hw/gpio/puv3_gpio.c b/hw/gpio/puv3_gpio.c
index 18671eb..39840aa 100644
--- a/hw/gpio/puv3_gpio.c
+++ b/hw/gpio/puv3_gpio.c
@@ -14,8 +14,12 @@
#undef DEBUG_PUV3
#include "hw/unicore32/puv3.h"
-typedef struct {
- SysBusDevice busdev;
+#define TYPE_PUV3_GPIO "puv3_gpio"
+#define PUV3_GPIO(obj) OBJECT_CHECK(PUV3GPIOState, (obj), TYPE_PUV3_GPIO)
+
+typedef struct PUV3GPIOState {
+ SysBusDevice parent_obj;
+
MemoryRegion iomem;
qemu_irq irq[9];
@@ -96,7 +100,7 @@ static const MemoryRegionOps puv3_gpio_ops = {
static int puv3_gpio_init(SysBusDevice *dev)
{
- PUV3GPIOState *s = FROM_SYSBUS(PUV3GPIOState, dev);
+ PUV3GPIOState *s = PUV3_GPIO(dev);
s->reg_GPLR = 0;
s->reg_GPDR = 0;
@@ -127,7 +131,7 @@ static void puv3_gpio_class_init(ObjectClass *klass, void *data)
}
static const TypeInfo puv3_gpio_info = {
- .name = "puv3_gpio",
+ .name = TYPE_PUV3_GPIO,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(PUV3GPIOState),
.class_init = puv3_gpio_class_init,
--
1.8.1.4
next prev parent reply other threads:[~2013-07-26 15:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-26 15:56 [Qemu-devel] [PATCH qom-next for-1.6 0/6] gpio: QOM cast cleanups Andreas Färber
2013-07-26 15:56 ` [Qemu-devel] [PATCH qom-next for-1.6 1/6] omap_gpio: QOM cast cleanup for omap_gpif_s Andreas Färber
2013-07-26 15:56 ` [Qemu-devel] [PATCH qom-next for-1.6 2/6] omap_gpio: QOM cast cleanup for omap2_gpif_s Andreas Färber
2013-07-26 15:56 ` [Qemu-devel] [PATCH qom-next for-1.6 3/6] pl061: Rename pl061_state to PL061State Andreas Färber
2013-07-26 15:56 ` [Qemu-devel] [PATCH qom-next for-1.6 4/6] pl061: QOM'ify pl061 and pl061_luminary Andreas Färber
2013-07-26 15:56 ` Andreas Färber [this message]
2013-07-26 15:56 ` [Qemu-devel] [PATCH qom-next for-1.6 6/6] gpio/zaurus: QOM cast cleanup Andreas Färber
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=1374854178-12445-6-git-send-email-afaerber@suse.de \
--to=afaerber@suse.de \
--cc=gxt@mprc.pku.edu.cn \
--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).