diff options
author | Andreas Färber <afaerber@suse.de> | 2012-11-25 02:37:14 +0100 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2013-06-07 12:14:45 +0200 |
commit | db895a1e6a97e919f9b86d60c969377357b05066 (patch) | |
tree | 72f6786abe90f7fa77d2f10416df73cb9d62e35a /hw/watchdog/wdt_ib700.c | |
parent | a3dcca567a1d4a5c79fb9c8fe2d9a21a4a7cebd5 (diff) |
isa: Use realizefn for ISADevice
Drop ISADeviceClass::init and the resulting no-op initfn and let
children implement their own realizefn. Adapt error handling.
Split off an instance_init where sensible.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/watchdog/wdt_ib700.c')
-rw-r--r-- | hw/watchdog/wdt_ib700.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/hw/watchdog/wdt_ib700.c b/hw/watchdog/wdt_ib700.c index 6b8e33a286..d85c8945ec 100644 --- a/hw/watchdog/wdt_ib700.c +++ b/hw/watchdog/wdt_ib700.c @@ -97,7 +97,7 @@ static const VMStateDescription vmstate_ib700 = { } }; -static int wdt_ib700_init(ISADevice *dev) +static void wdt_ib700_realize(DeviceState *dev, Error **errp) { IB700State *s = IB700(dev); @@ -106,8 +106,6 @@ static int wdt_ib700_init(ISADevice *dev) s->timer = qemu_new_timer_ns(vm_clock, ib700_timer_expired, s); register_ioport_write(0x441, 2, 1, ib700_write_disable_reg, s); register_ioport_write(0x443, 2, 1, ib700_write_enable_reg, s); - - return 0; } static void wdt_ib700_reset(DeviceState *dev) @@ -127,8 +125,8 @@ static WatchdogTimerModel model = { static void wdt_ib700_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - ISADeviceClass *ic = ISA_DEVICE_CLASS(klass); - ic->init = wdt_ib700_init; + + dc->realize = wdt_ib700_realize; dc->reset = wdt_ib700_reset; dc->vmsd = &vmstate_ib700; } |