提交 cd7c50a4 编写于 作者: M Markus Armbruster 提交者: Andreas Färber

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: NMarkus Armbruster <armbru@redhat.com>
Reviewed-by: NFabien Chouteau <chouteau@adacore.com>
Signed-off-by: NAndreas Färber <afaerber@suse.de>
上级 e25b89e5
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册