summaryrefslogtreecommitdiffstats
path: root/hw/ssi/ssi.c
diff options
context:
space:
mode:
authorCédric Le Goater2016-07-04 14:06:37 +0200
committerPeter Maydell2016-07-04 14:15:22 +0200
commit7673bb4cd305637b37bd0c0b79dd3bf6deb55172 (patch)
treecdbde26ac2323bac0cf260941d585baad2056897 /hw/ssi/ssi.c
parentxilinx_zynq: Connect devcfg to the Zynq machine model (diff)
downloadqemu-7673bb4cd305637b37bd0c0b79dd3bf6deb55172.tar.gz
qemu-7673bb4cd305637b37bd0c0b79dd3bf6deb55172.tar.xz
qemu-7673bb4cd305637b37bd0c0b79dd3bf6deb55172.zip
ssi: change ssi_slave_init to be a realize ops
This enables qemu to handle late inits and report errors. All the SSI slave routine names were changed accordingly. Code was modified to handle errors when possible (m25p80 and ssi-sd) Tested with the m25p80 slave object. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Cédric Le Goater <clg@kaod.org> Message-id: 1467138270-32481-2-git-send-email-clg@kaod.org Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/ssi/ssi.c')
-rw-r--r--hw/ssi/ssi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/ssi/ssi.c b/hw/ssi/ssi.c
index 9791c0d947..7eaaf565fd 100644
--- a/hw/ssi/ssi.c
+++ b/hw/ssi/ssi.c
@@ -54,7 +54,7 @@ static uint32_t ssi_transfer_raw_default(SSISlave *dev, uint32_t val)
return 0;
}
-static int ssi_slave_init(DeviceState *dev)
+static void ssi_slave_realize(DeviceState *dev, Error **errp)
{
SSISlave *s = SSI_SLAVE(dev);
SSISlaveClass *ssc = SSI_SLAVE_GET_CLASS(s);
@@ -64,7 +64,7 @@ static int ssi_slave_init(DeviceState *dev)
qdev_init_gpio_in_named(dev, ssi_cs_default, SSI_GPIO_CS, 1);
}
- return ssc->init(s);
+ ssc->realize(s, errp);
}
static void ssi_slave_class_init(ObjectClass *klass, void *data)
@@ -72,7 +72,7 @@ static void ssi_slave_class_init(ObjectClass *klass, void *data)
SSISlaveClass *ssc = SSI_SLAVE_CLASS(klass);
DeviceClass *dc = DEVICE_CLASS(klass);
- dc->init = ssi_slave_init;
+ dc->realize = ssi_slave_realize;
dc->bus_type = TYPE_SSI_BUS;
if (!ssc->transfer_raw) {
ssc->transfer_raw = ssi_transfer_raw_default;