From c312c2c333b88145b3073cf5acd8362af3f0cc6e Mon Sep 17 00:00:00 2001 From: Wei Yongjun Date: Tue, 25 Apr 2017 11:29:30 +0000 Subject: [PATCH] pinctrl: artpec6: Fix return value check in artpec6_pmx_probe() In case of error, the function pinctrl_register() returns ERR_PTR() not NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun Acked-by: Jesper Nilsson Signed-off-by: Linus Walleij --- 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 ffe33cfde5b2..357516d524bd 100644 --- a/drivers/pinctrl/pinctrl-artpec6.c +++ b/drivers/pinctrl/pinctrl-artpec6.c @@ -937,9 +937,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); -- 2.20.1