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/applesmc.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/applesmc.c')
-rw-r--r-- | hw/misc/applesmc.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/hw/misc/applesmc.c b/hw/misc/applesmc.c index 78904a816b..46f4fbd005 100644 --- a/hw/misc/applesmc.c +++ b/hw/misc/applesmc.c @@ -201,7 +201,7 @@ static void qdev_applesmc_isa_reset(DeviceState *dev) applesmc_add_key(s, "MSSD", 1, "\0x3"); } -static int applesmc_isa_init(ISADevice *dev) +static void applesmc_isa_realize(DeviceState *dev, Error **errp) { AppleSMCState *s = APPLE_SMC(dev); @@ -220,9 +220,7 @@ static int applesmc_isa_init(ISADevice *dev) } QLIST_INIT(&s->data_def); - qdev_applesmc_isa_reset(&dev->qdev); - - return 0; + qdev_applesmc_isa_reset(dev); } static Property applesmc_isa_properties[] = { @@ -235,8 +233,8 @@ static Property applesmc_isa_properties[] = { static void qdev_applesmc_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - ISADeviceClass *ic = ISA_DEVICE_CLASS(klass); - ic->init = applesmc_isa_init; + + dc->realize = applesmc_isa_realize; dc->reset = qdev_applesmc_isa_reset; dc->props = applesmc_isa_properties; } |