提交 086eec2d 编写于 作者: D Dan Carpenter 提交者: Marc Zyngier

irqchip/mbigen: Checking for IS_ERR() instead of NULL

of_platform_device_create() returns NULL on error, it never returns
error pointers.

Fixes: ed2a1002 ('irqchip/mbigen: Handle multiple device nodes in a mbigen module')
Acked-by: NMarc Zyngier <marc.zyngier@arm.com>
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
上级 074f23b6
......@@ -263,8 +263,8 @@ static int mbigen_device_probe(struct platform_device *pdev)
parent = platform_bus_type.dev_root;
child = of_platform_device_create(np, NULL, parent);
if (IS_ERR(child))
return PTR_ERR(child);
if (!child)
return -ENOMEM;
if (of_property_read_u32(child->dev.of_node, "num-pins",
&num_pins) < 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册