pinctrl: artpec6: Fix return value check in artpec6_pmx_probe()
authorWei Yongjun <weiyongjun1@huawei.com>
Tue, 25 Apr 2017 11:29:30 +0000 (11:29 +0000)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 28 Apr 2017 07:40:52 +0000 (09:40 +0200)
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 <weiyongjun1@huawei.com>
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-artpec6.c

index ffe33cfde5b2534428e15b7b3c12dc9431534312..357516d524bda8fde3f6ba1450aaf9bec9059c99 100644 (file)
@@ -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);