From db895a1e6a97e919f9b86d60c969377357b05066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sun, 25 Nov 2012 02:37:14 +0100 Subject: isa: Use realizefn for ISADevice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- hw/misc/sga.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'hw/misc/sga.c') diff --git a/hw/misc/sga.c b/hw/misc/sga.c index c842190..08803e7 100644 --- a/hw/misc/sga.c +++ b/hw/misc/sga.c @@ -38,17 +38,16 @@ typedef struct ISASGAState { ISADevice parent_obj; } ISASGAState; -static int sga_initfn(ISADevice *dev) +static void sga_realizefn(DeviceState *dev, Error **errp) { rom_add_vga(SGABIOS_FILENAME); - return 0; } static void sga_class_initfn(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - ISADeviceClass *ic = ISA_DEVICE_CLASS(klass); - ic->init = sga_initfn; + + dc->realize = sga_realizefn; dc->desc = "Serial Graphics Adapter"; } -- cgit v1.1