Skip to content

Commit

Permalink
pinctrl: ingenic: checking for NULL instead of IS_ERR()
Browse files Browse the repository at this point in the history
devm_pinctrl_register() returns error pointers, it doesn't return NULL.

Fixes: b5c23aa ("pinctrl: add a pinctrl driver for the Ingenic jz47xx SoCs")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Dan Carpenter authored and Linus Walleij committed Jun 20, 2017
1 parent 1bd303d commit e7f4c4b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/pinctrl/pinctrl-ingenic.c
Original file line number Diff line number Diff line change
Expand Up @@ -785,9 +785,9 @@ int ingenic_pinctrl_probe(struct platform_device *pdev)
}

jzpc->pctl = devm_pinctrl_register(dev, pctl_desc, jzpc);
if (!jzpc->pctl) {
if (IS_ERR(jzpc->pctl)) {
dev_err(dev, "Failed to register pinctrl\n");
return -EINVAL;
return PTR_ERR(jzpc->pctl);
}

for (i = 0; i < chip_info->num_groups; i++) {
Expand Down

0 comments on commit e7f4c4b

Please sign in to comment.