Skip to contentSkip to conversation

gpio: pxa: checking IS_ERR() instead of NULL

PATCH In review Dan Carpenter 2 participants 2 messages Jan 5, 2016

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

PATCH 1/1 gpio: pxa: checking IS_ERR() instead of NULL

irq_domain_add_legacy() returns NULL on error, it doesn't return error pointers.

Fixes 384ca3c6a28d ('gpio: pxa: change the interrupt management')
drivers/gpio/gpio-pxa.c +2 -2
index c2d1a47..415852d 100644
@@ -646,8 +646,8 @@ static int pxa_gpio_probe(struct platform_device *pdev)
 	pchip->irqdomain = irq_domain_add_legacy(pdev->dev.of_node,
 						 pxa_last_gpio + 1, irq_base,
 						 0, &pxa_irq_domain_ops, pchip);
-	if (IS_ERR(pchip->irqdomain))
-		return PTR_ERR(pchip->irqdomain);
+	if (!pchip->irqdomain)
+		return -ENOMEM;
 
 	irq0 = platform_get_irq_byname(pdev, "gpio0");
 	irq1 = platform_get_irq_byname(pdev, "gpio1");
#1 lore raw
Quoted 5 lines · Dan Carpenter

irq_domain_add_legacy() returns NULL on error, it doesn't return error pointers.

Fixes 384ca3c6a28d ('gpio: pxa: change the interrupt management')

Patch applied.

Yours,
Linus Walleij