mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-11 16:00:50 -07:00
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>
This commit is contained in:
parent
a3dcca567a
commit
db895a1e6a
34 changed files with 292 additions and 243 deletions
|
|
@ -66,7 +66,7 @@ static int pic_dispatch_post_load(void *opaque, int version_id)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pic_init_common(ISADevice *dev)
|
||||
static void pic_common_realize(DeviceState *dev, Error **errp)
|
||||
{
|
||||
PICCommonState *s = PIC_COMMON(dev);
|
||||
PICCommonClass *info = PIC_COMMON_GET_CLASS(s);
|
||||
|
|
@ -78,9 +78,7 @@ static int pic_init_common(ISADevice *dev)
|
|||
isa_register_ioport(NULL, &s->elcr_io, s->elcr_addr);
|
||||
}
|
||||
|
||||
qdev_set_legacy_instance_id(DEVICE(dev), s->iobase, 1);
|
||||
|
||||
return 0;
|
||||
qdev_set_legacy_instance_id(dev, s->iobase, 1);
|
||||
}
|
||||
|
||||
ISADevice *i8259_init_chip(const char *name, ISABus *bus, bool master)
|
||||
|
|
@ -135,13 +133,12 @@ static Property pic_properties_common[] = {
|
|||
|
||||
static void pic_common_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
ISADeviceClass *ic = ISA_DEVICE_CLASS(klass);
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
dc->vmsd = &vmstate_pic_common;
|
||||
dc->no_user = 1;
|
||||
dc->props = pic_properties_common;
|
||||
ic->init = pic_init_common;
|
||||
dc->realize = pic_common_realize;
|
||||
}
|
||||
|
||||
static const TypeInfo pic_common_type = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue