Skip to content

Commit

Permalink
pinctrl: artpec6: Fix return value check in artpec6_pmx_probe()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Jesper Nilsson <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
  • Loading branch information
Wei Yongjun authored and linusw committed Apr 28, 2017
1 parent a5bf5fc commit c312c2c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/pinctrl/pinctrl-artpec6.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c312c2c

Please sign in to comment.