summaryrefslogtreecommitdiffstats
path: root/include/hw/sparc
diff options
context:
space:
mode:
authorMarkus Armbruster2015-02-04 18:33:03 +0100
committerAndreas Färber2015-02-24 00:19:05 +0100
commitcd7c50a48dd484637aec36c351728ad0f140805a (patch)
tree8b8fcfdc96d5e3dac66ba41cd78f47babb2fb5a3 /include/hw/sparc
parentide/isa: Replace unchecked qdev_init() by qdev_init_nofail() (diff)
downloadqemu-cd7c50a48dd484637aec36c351728ad0f140805a.tar.gz
qemu-cd7c50a48dd484637aec36c351728ad0f140805a.tar.xz
qemu-cd7c50a48dd484637aec36c351728ad0f140805a.zip
leon3: Replace unchecked qdev_init() by qdev_init_nofail()
grlib_irqmp_create(), grlib_gptimer_create() and grlib_apbuart_create() are helpers to create and realize GRLIB devices. Their only caller leon3_generic_hw_init() doesn't check for failure. Only the first can actually fail, and only when the caller fails to set up a pointer property, which is a programming error. Replace qdev_init() by qdev_init_nofail(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Fabien Chouteau <chouteau@adacore.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'include/hw/sparc')
-rw-r--r--include/hw/sparc/grlib.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/include/hw/sparc/grlib.h b/include/hw/sparc/grlib.h
index 470ce72250..9a0db7b47b 100644
--- a/include/hw/sparc/grlib.h
+++ b/include/hw/sparc/grlib.h
@@ -55,9 +55,7 @@ DeviceState *grlib_irqmp_create(hwaddr base,
qdev_prop_set_ptr(dev, "set_pil_in", set_pil_in);
qdev_prop_set_ptr(dev, "set_pil_in_opaque", env);
- if (qdev_init(dev)) {
- return NULL;
- }
+ qdev_init_nofail(dev);
env->irq_manager = dev;
@@ -87,9 +85,7 @@ DeviceState *grlib_gptimer_create(hwaddr base,
qdev_prop_set_uint32(dev, "frequency", freq);
qdev_prop_set_uint32(dev, "irq-line", base_irq);
- if (qdev_init(dev)) {
- return NULL;
- }
+ qdev_init_nofail(dev);
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
@@ -112,9 +108,7 @@ DeviceState *grlib_apbuart_create(hwaddr base,
dev = qdev_create(NULL, "grlib,apbuart");
qdev_prop_set_chr(dev, "chrdev", serial);
- if (qdev_init(dev)) {
- return NULL;
- }
+ qdev_init_nofail(dev);
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);