From: Dan Carpenter Date: Wed, 14 Jun 2017 09:12:09 +0000 (+0300) Subject: pinctrl: ingenic: checking for NULL instead of IS_ERR() X-Git-Tag: v4.13-rc1~139^2~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e7f4c4bf99ad5edca35ccc18105daf5279b54919;p=platform%2Fkernel%2Flinux-exynos.git pinctrl: ingenic: checking for NULL instead of IS_ERR() devm_pinctrl_register() returns error pointers, it doesn't return NULL. Fixes: b5c23aa46537 ("pinctrl: add a pinctrl driver for the Ingenic jz47xx SoCs") Signed-off-by: Dan Carpenter Signed-off-by: Linus Walleij --- diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-ingenic.c index d8473d9..d8e8842 100644 --- a/drivers/pinctrl/pinctrl-ingenic.c +++ b/drivers/pinctrl/pinctrl-ingenic.c @@ -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++) {