qdev: Remove DeviceClass::init() and ::exit()

Since no devices use it, we can safely remove it.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20180419212727.26095-5-f4bug@amsat.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Removal of DeviceClass::init() moved from previous patch, missing
documentation updates supplied]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20180528144509.15812-5-armbru@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Philippe Mathieu-Daudé 2018-05-28 16:45:09 +02:00 committed by Paolo Bonzini
parent dbfe00130e
commit ff46d9d4d6
2 changed files with 4 additions and 44 deletions

View file

@ -208,32 +208,6 @@ void device_listener_unregister(DeviceListener *listener)
QTAILQ_REMOVE(&device_listeners, listener, link);
}
static void device_realize(DeviceState *dev, Error **errp)
{
DeviceClass *dc = DEVICE_GET_CLASS(dev);
if (dc->init) {
int rc = dc->init(dev);
if (rc < 0) {
error_setg(errp, "Device initialization failed.");
return;
}
}
}
static void device_unrealize(DeviceState *dev, Error **errp)
{
DeviceClass *dc = DEVICE_GET_CLASS(dev);
if (dc->exit) {
int rc = dc->exit(dev);
if (rc < 0) {
error_setg(errp, "Device exit failed.");
return;
}
}
}
void qdev_set_legacy_instance_id(DeviceState *dev, int alias_id,
int required_for_version)
{
@ -1065,8 +1039,6 @@ static void device_class_init(ObjectClass *class, void *data)
DeviceClass *dc = DEVICE_CLASS(class);
class->unparent = device_unparent;
dc->realize = device_realize;
dc->unrealize = device_unrealize;
/* by default all devices were considered as hotpluggable,
* so with intent to check it in generic qdev_unplug() /