aboutsummaryrefslogtreecommitdiff
path: root/hw/sparc64
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-07-27 13:48:18 +0200
committerAndreas Färber <afaerber@suse.de>2013-07-29 21:07:00 +0200
commit13575cf6dbe88ffa9d2f03dace03aedd9e003f8d (patch)
tree52e397eff89958f874bd455eaf13b1b2e98b6747 /hw/sparc64
parent5ab6b4c661ecf3c824e08de6f5c99a855d00fa84 (diff)
sun4u: QOM cast cleanup for PROMState
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/sparc64')
-rw-r--r--hw/sparc64/sun4u.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index 34a5e7331c..9568028660 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -632,8 +632,12 @@ static const TypeInfo ebus_info = {
.class_init = ebus_class_init,
};
+#define TYPE_OPENPROM "openprom"
+#define OPENPROM(obj) OBJECT_CHECK(PROMState, (obj), TYPE_OPENPROM)
+
typedef struct PROMState {
- SysBusDevice busdev;
+ SysBusDevice parent_obj;
+
MemoryRegion prom;
} PROMState;
@@ -651,7 +655,7 @@ static void prom_init(hwaddr addr, const char *bios_name)
char *filename;
int ret;
- dev = qdev_create(NULL, "openprom");
+ dev = qdev_create(NULL, TYPE_OPENPROM);
qdev_init_nofail(dev);
s = SYS_BUS_DEVICE(dev);
@@ -680,7 +684,7 @@ static void prom_init(hwaddr addr, const char *bios_name)
static int prom_init1(SysBusDevice *dev)
{
- PROMState *s = FROM_SYSBUS(PROMState, dev);
+ PROMState *s = OPENPROM(dev);
memory_region_init_ram(&s->prom, OBJECT(s), "sun4u.prom", PROM_SIZE_MAX);
vmstate_register_ram_global(&s->prom);
@@ -703,7 +707,7 @@ static void prom_class_init(ObjectClass *klass, void *data)
}
static const TypeInfo prom_info = {
- .name = "openprom",
+ .name = TYPE_OPENPROM,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(PROMState),
.class_init = prom_class_init,