Skip to content

Commit

Permalink
pl031: QOM cast cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Färber <afaerber@suse.de>
  • Loading branch information
afaerber committed Jul 29, 2013
1 parent b91f0df commit d3b8004
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions hw/timer/pl031.c
Expand Up @@ -33,8 +33,12 @@ do { printf("pl031: " fmt , ## __VA_ARGS__); } while (0)
#define RTC_MIS 0x18 /* Masked interrupt status register */
#define RTC_ICR 0x1c /* Interrupt clear register */

#define TYPE_PL031 "pl031"
#define PL031(obj) OBJECT_CHECK(PL031State, (obj), TYPE_PL031)

typedef struct PL031State {
SysBusDevice busdev;
SysBusDevice parent_obj;

MemoryRegion iomem;
QEMUTimer *timer;
qemu_irq irq;
Expand Down Expand Up @@ -189,7 +193,7 @@ static const MemoryRegionOps pl031_ops = {

static int pl031_init(SysBusDevice *dev)
{
PL031State *s = FROM_SYSBUS(PL031State, dev);
PL031State *s = PL031(dev);
struct tm tm;

memory_region_init_io(&s->iomem, OBJECT(s), &pl031_ops, s, "pl031", 0x1000);
Expand Down Expand Up @@ -251,7 +255,7 @@ static void pl031_class_init(ObjectClass *klass, void *data)
}

static const TypeInfo pl031_info = {
.name = "pl031",
.name = TYPE_PL031,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(PL031State),
.class_init = pl031_class_init,
Expand Down

0 comments on commit d3b8004

Please sign in to comment.