Skip to contentSkip to conversation

pinctrl: ingenic: checking for NULL instead of IS_ERR()

PATCH In review Dan Carpenter 2 participants 2 messages Jun 14, 2017 – Jun 20, 2017

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

PATCH 1/1 pinctrl: ingenic: checking for NULL instead of IS_ERR()

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

Fixes b5c23aa46537 ("pinctrl: add a pinctrl driver for the Ingenic jz47xx SoCs")
drivers/pinctrl/pinctrl-ingenic.c +2 -2
index d8473d929cb1..d8e8842967d6 100644
@@ -785,9 +785,9 @@ int ingenic_pinctrl_probe(struct platform_device *pdev)
 	}
 
 	jzpc->pctl = devm_pinctrl_register(dev, pctl_desc, jzpc);
-	if (!jzpc->pctl) {
+	if (IS_ERR(jzpc->pctl)) {
 		dev_err(dev, "Failed to register pinctrl\n");
-		return -EINVAL;
+		return PTR_ERR(jzpc->pctl);
 	}
 
 	for (i = 0; i < chip_info->num_groups; i++) {
#1 lore raw
Quoted 4 lines · Dan Carpenter

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

Fixes b5c23aa46537 ("pinctrl: add a pinctrl driver for the Ingenic jz47xx SoCs")

Patch applied.

Yours,
Linus Walleij