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>
This commit is contained in:
Markus Armbruster 2015-02-04 18:33:03 +01:00 committed by Andreas Färber
parent e25b89e520
commit cd7c50a48d

View File

@ -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);