wdt_ib700: QOM'ify
Introduce type constant and cast macro to obsolete DO_UPCAST(). Prepares for ISA realizefn. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Andreas Färber <afaerber@suse.de> Message-id: 1367093935-29091-21-git-send-email-afaerber@suse.de Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
f02317ad4e
commit
61e477f4c7
@ -35,8 +35,12 @@
|
|||||||
#define ib700_debug(fs,...)
|
#define ib700_debug(fs,...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define TYPE_IB700 "ib700"
|
||||||
|
#define IB700(obj) OBJECT_CHECK(IB700State, (obj), TYPE_IB700)
|
||||||
|
|
||||||
typedef struct IB700state {
|
typedef struct IB700state {
|
||||||
ISADevice dev;
|
ISADevice parent_obj;
|
||||||
|
|
||||||
QEMUTimer *timer;
|
QEMUTimer *timer;
|
||||||
} IB700State;
|
} IB700State;
|
||||||
|
|
||||||
@ -95,7 +99,7 @@ static const VMStateDescription vmstate_ib700 = {
|
|||||||
|
|
||||||
static int wdt_ib700_init(ISADevice *dev)
|
static int wdt_ib700_init(ISADevice *dev)
|
||||||
{
|
{
|
||||||
IB700State *s = DO_UPCAST(IB700State, dev, dev);
|
IB700State *s = IB700(dev);
|
||||||
|
|
||||||
ib700_debug("watchdog init\n");
|
ib700_debug("watchdog init\n");
|
||||||
|
|
||||||
@ -108,7 +112,7 @@ static int wdt_ib700_init(ISADevice *dev)
|
|||||||
|
|
||||||
static void wdt_ib700_reset(DeviceState *dev)
|
static void wdt_ib700_reset(DeviceState *dev)
|
||||||
{
|
{
|
||||||
IB700State *s = DO_UPCAST(IB700State, dev.qdev, dev);
|
IB700State *s = IB700(dev);
|
||||||
|
|
||||||
ib700_debug("watchdog reset\n");
|
ib700_debug("watchdog reset\n");
|
||||||
|
|
||||||
@ -130,7 +134,7 @@ static void wdt_ib700_class_init(ObjectClass *klass, void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo wdt_ib700_info = {
|
static const TypeInfo wdt_ib700_info = {
|
||||||
.name = "ib700",
|
.name = TYPE_IB700,
|
||||||
.parent = TYPE_ISA_DEVICE,
|
.parent = TYPE_ISA_DEVICE,
|
||||||
.instance_size = sizeof(IB700State),
|
.instance_size = sizeof(IB700State),
|
||||||
.class_init = wdt_ib700_class_init,
|
.class_init = wdt_ib700_class_init,
|
||||||
|
Loading…
Reference in New Issue
Block a user