linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] pinctrl: artpec6: Fix return value check in artpec6_pmx_probe()
@ 2017-04-25  3:29 Wei Yongjun
  2017-04-25  8:31 ` Jesper Nilsson
  2017-04-25 11:29 ` [PATCH -next v2] " Wei Yongjun
  0 siblings, 2 replies; 9+ messages in thread
From: Wei Yongjun @ 2017-04-25  3:29 UTC (permalink / raw)
  To: Jesper Nilsson, Lars Persson, Niklas Cassel, Linus Walleij
  Cc: Wei Yongjun, linux-arm-kernel, linux-gpio

From: Wei Yongjun <weiyongjun1@huawei.com>

In case of error, the function pinctrl_register() returns
NULL not ERR_PTR(). The IS_ERR() test in the return value
check should be replaced with NULL test.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/pinctrl/pinctrl-artpec6.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-artpec6.c b/drivers/pinctrl/pinctrl-artpec6.c
index b5a2eff..6a16019 100644
--- a/drivers/pinctrl/pinctrl-artpec6.c
+++ b/drivers/pinctrl/pinctrl-artpec6.c
@@ -938,9 +938,9 @@ static int artpec6_pmx_probe(struct platform_device *pdev)
 	pmx->num_pin_groups = ARRAY_SIZE(artpec6_pin_groups);
 	pmx->pctl	    = pinctrl_register(&artpec6_desc, &pdev->dev, pmx);
 
-	if (!pmx->pctl) {
+	if (IS_ERR(pmx->pctl)) {
 		dev_err(&pdev->dev, "could not register pinctrl driver\n");
-		return -EINVAL;
+		return PTR_ERR(pmx->pctl);
 	}
 
 	platform_set_drvdata(pdev, pmx);


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-04-28 14:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-25  3:29 [PATCH -next] pinctrl: artpec6: Fix return value check in artpec6_pmx_probe() Wei Yongjun
2017-04-25  8:31 ` Jesper Nilsson
2017-04-25  9:18   ` weiyongjun (A)
2017-04-25 11:29 ` [PATCH -next v2] " Wei Yongjun
2017-04-25 13:40   ` Jesper Nilsson
2017-04-28  7:43     ` Linus Walleij
2017-04-28  7:58       ` Jesper Nilsson
2017-04-28 14:26         ` Tony Lindgren
2017-04-28  7:41   ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).