From ff46d9d4d6dda7716c534a300087f447c285ad2b Mon Sep 17 00:00:00 2001 From: Philippe Mathieu-Daudé Date: Mon, 28 May 2018 16:45:09 +0200 Subject: qdev: Remove DeviceClass::init() and ::exit() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since no devices use it, we can safely remove it. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20180419212727.26095-5-f4bug@amsat.org> Reviewed-by: Markus Armbruster [Removal of DeviceClass::init() moved from previous patch, missing documentation updates supplied] Signed-off-by: Markus Armbruster Message-Id: <20180528144509.15812-5-armbru@redhat.com> Signed-off-by: Paolo Bonzini --- hw/core/qdev.c | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'hw/core') diff --git a/hw/core/qdev.c b/hw/core/qdev.c index f6f92473b8..ffec461791 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -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() / -- cgit v1.2.3