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/misc/debugexit.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/misc/debugexit.c')
-rw-r--r-- | hw/misc/debugexit.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/hw/misc/debugexit.c b/hw/misc/debugexit.c index 59bed5bff5..ee254e46d2 100644 --- a/hw/misc/debugexit.c +++ b/hw/misc/debugexit.c @@ -35,15 +35,15 @@ static const MemoryRegionOps debug_exit_ops = { .endianness = DEVICE_LITTLE_ENDIAN, }; -static int debug_exit_initfn(ISADevice *dev) +static void debug_exit_realizefn(DeviceState *d, Error **errp) { - ISADebugExitState *isa = ISA_DEBUG_EXIT_DEVICE(dev); + ISADevice *dev = ISA_DEVICE(d); + ISADebugExitState *isa = ISA_DEBUG_EXIT_DEVICE(d); memory_region_init_io(&isa->io, &debug_exit_ops, isa, TYPE_ISA_DEBUG_EXIT_DEVICE, isa->iosize); memory_region_add_subregion(isa_address_space_io(dev), isa->iobase, &isa->io); - return 0; } static Property debug_exit_properties[] = { @@ -55,8 +55,8 @@ static Property debug_exit_properties[] = { static void debug_exit_class_initfn(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - ISADeviceClass *ic = ISA_DEVICE_CLASS(klass); - ic->init = debug_exit_initfn; + + dc->realize = debug_exit_realizefn; dc->props = debug_exit_properties; } |