Skip to contentSkip to conversation

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

PATCH New Dan Carpenter 1 participant 1 message Apr 4, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 irqchip/mbigen: checking for IS_ERR() instead of NULL

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

Fixes ed2a1002d25c ('irqchip/mbigen: Handle multiple device nodes in a mbigen module')
drivers/irqchip/irq-mbigen.c +2 -2
index d67baa2..03b79b0 100644
@@ -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) {