aboutsummaryrefslogtreecommitdiff
path: root/hw/i2c/smbus_ich9.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2015-01-19 15:52:30 +0100
committerMichael S. Tsirkin <mst@redhat.com>2015-02-26 12:42:16 +0100
commit9af21dbee14c5165598d17115ade63184ec0dd8b (patch)
tree8bb365934bdac7cb5e1b2cb7cf1dbc32aea4655a /hw/i2c/smbus_ich9.c
parent7ee6c1e182cca6ccf5253569fca3d05826efb4e9 (diff)
pci: Trivial device model conversions to realize
Convert the device models where initialization obviously can't fail. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Gonglei <arei.gonglei@huawei.com>
Diffstat (limited to 'hw/i2c/smbus_ich9.c')
-rw-r--r--hw/i2c/smbus_ich9.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c
index 0803dc4d18..91d4d322ca 100644
--- a/hw/i2c/smbus_ich9.c
+++ b/hw/i2c/smbus_ich9.c
@@ -71,7 +71,7 @@ static void ich9_smbus_write_config(PCIDevice *d, uint32_t address,
}
}
-static int ich9_smbus_initfn(PCIDevice *d)
+static void ich9_smbus_realize(PCIDevice *d, Error **errp)
{
ICH9SMBState *s = ICH9_SMB_DEVICE(d);
@@ -84,7 +84,6 @@ static int ich9_smbus_initfn(PCIDevice *d)
pm_smbus_init(&d->qdev, &s->smb);
pci_register_bar(d, ICH9_SMB_SMB_BASE_BAR, PCI_BASE_ADDRESS_SPACE_IO,
&s->smb.io);
- return 0;
}
static void ich9_smb_class_init(ObjectClass *klass, void *data)
@@ -98,7 +97,7 @@ static void ich9_smb_class_init(ObjectClass *klass, void *data)
k->class_id = PCI_CLASS_SERIAL_SMBUS;
dc->vmsd = &vmstate_ich9_smbus;
dc->desc = "ICH9 SMBUS Bridge";
- k->init = ich9_smbus_initfn;
+ k->realize = ich9_smbus_realize;
k->config_write = ich9_smbus_write_config;
/*
* Reason: part of ICH9 southbridge, needs to be wired up by