diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2017-04-25 07:29:30 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2017-04-28 03:40:52 -0400 |
commit | c312c2c333b88145b3073cf5acd8362af3f0cc6e (patch) | |
tree | ffda4a5cc7f3ab763eecef87531f95922963cf6d | |
parent | a5bf5fc060b0095ebd6f1886da8ec482697176fa (diff) |
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 <weiyongjun1@huawei.com>
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/pinctrl/pinctrl-artpec6.c | 4 |
1 files 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) | |||
937 | pmx->num_pin_groups = ARRAY_SIZE(artpec6_pin_groups); | 937 | pmx->num_pin_groups = ARRAY_SIZE(artpec6_pin_groups); |
938 | pmx->pctl = pinctrl_register(&artpec6_desc, &pdev->dev, pmx); | 938 | pmx->pctl = pinctrl_register(&artpec6_desc, &pdev->dev, pmx); |
939 | 939 | ||
940 | if (!pmx->pctl) { | 940 | if (IS_ERR(pmx->pctl)) { |
941 | dev_err(&pdev->dev, "could not register pinctrl driver\n"); | 941 | dev_err(&pdev->dev, "could not register pinctrl driver\n"); |
942 | return -EINVAL; | 942 | return PTR_ERR(pmx->pctl); |
943 | } | 943 | } |
944 | 944 | ||
945 | platform_set_drvdata(pdev, pmx); | 945 | platform_set_drvdata(pdev, pmx); |