wdt_i6300esb: QOMify

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
Gonglei 2015-05-13 08:43:25 +08:00 committed by Michael Tokarev
parent acff3e48b7
commit 41fc9050fe

View File

@ -103,6 +103,10 @@ struct I6300State {
typedef struct I6300State I6300State;
#define TYPE_WATCHDOG_I6300ESB_DEVICE "i6300esb"
#define WATCHDOG_I6300ESB_DEVICE(obj) \
OBJECT_CHECK(I6300State, (obj), TYPE_WATCHDOG_I6300ESB_DEVICE)
/* This function is called when the watchdog has either been enabled
* (hence it starts counting down) or has been keep-alived.
*/
@ -150,7 +154,7 @@ static void i6300esb_disable_timer(I6300State *d)
static void i6300esb_reset(DeviceState *dev)
{
PCIDevice *pdev = PCI_DEVICE(dev);
I6300State *d = DO_UPCAST(I6300State, dev, pdev);
I6300State *d = WATCHDOG_I6300ESB_DEVICE(pdev);
i6300esb_debug("I6300State = %p\n", d);
@ -213,7 +217,7 @@ static void i6300esb_timer_expired(void *vp)
static void i6300esb_config_write(PCIDevice *dev, uint32_t addr,
uint32_t data, int len)
{
I6300State *d = DO_UPCAST(I6300State, dev, dev);
I6300State *d = WATCHDOG_I6300ESB_DEVICE(dev);
int old;
i6300esb_debug("addr = %x, data = %x, len = %d\n", addr, data, len);
@ -241,7 +245,7 @@ static void i6300esb_config_write(PCIDevice *dev, uint32_t addr,
static uint32_t i6300esb_config_read(PCIDevice *dev, uint32_t addr, int len)
{
I6300State *d = DO_UPCAST(I6300State, dev, dev);
I6300State *d = WATCHDOG_I6300ESB_DEVICE(dev);
uint32_t data;
i6300esb_debug ("addr = %x, len = %d\n", addr, len);
@ -416,7 +420,7 @@ static const VMStateDescription vmstate_i6300esb = {
static void i6300esb_realize(PCIDevice *dev, Error **errp)
{
I6300State *d = DO_UPCAST(I6300State, dev, dev);
I6300State *d = WATCHDOG_I6300ESB_DEVICE(dev);
i6300esb_debug("I6300State = %p\n", d);
@ -451,7 +455,7 @@ static void i6300esb_class_init(ObjectClass *klass, void *data)
}
static const TypeInfo i6300esb_info = {
.name = "i6300esb",
.name = TYPE_WATCHDOG_I6300ESB_DEVICE,
.parent = TYPE_PCI_DEVICE,
.instance_size = sizeof(I6300State),
.class_init = i6300esb_class_init,