Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1370550 > unrolled thread

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

Started byDan Carpenter <dan.carpenter@oracle.com>
First post2016-04-04 13:20 +0200
Last post2016-04-04 13:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [patch] irqchip/mbigen: checking for IS_ERR() instead of NULL Dan Carpenter <dan.carpenter@oracle.com> - 2016-04-04 13:20 +0200

#1370550 — [patch] irqchip/mbigen: checking for IS_ERR() instead of NULL

FromDan Carpenter <dan.carpenter@oracle.com>
Date2016-04-04 13:20 +0200
Subject[patch] irqchip/mbigen: checking for IS_ERR() instead of NULL
Message-ID<rkaI2-2bB-9@gated-at.bofh.it>
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')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/irqchip/irq-mbigen.c b/drivers/irqchip/irq-mbigen.c
index d67baa2..03b79b0 100644
--- a/drivers/irqchip/irq-mbigen.c
+++ b/drivers/irqchip/irq-mbigen.c
@@ -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) {

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web