* [PATCH] pinctrl: ingenic: checking for NULL instead of IS_ERR()
@ 2017-06-14 9:12 Dan Carpenter
2017-06-20 9:36 ` Linus Walleij
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-06-14 9:12 UTC (permalink / raw)
To: Linus Walleij, Paul Cercueil; +Cc: linux-gpio, kernel-janitors
devm_pinctrl_register() returns error pointers, it doesn't return NULL.
Fixes: b5c23aa46537 ("pinctrl: add a pinctrl driver for the Ingenic jz47xx SoCs")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-ingenic.c
index d8473d929cb1..d8e8842967d6 100644
--- a/drivers/pinctrl/pinctrl-ingenic.c
+++ b/drivers/pinctrl/pinctrl-ingenic.c
@@ -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++) {
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-06-20 9:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-14 9:12 [PATCH] pinctrl: ingenic: checking for NULL instead of IS_ERR() Dan Carpenter
2017-06-20 9:36 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox