From: Wei Yongjun Date: Mon, 11 Mar 2013 14:08:12 +0000 (+0800) Subject: sh-pfc: Fix return value check in sh_pfc_register_pinctrl() X-Git-Tag: firefly_0821_release~3680^2~546^2~4^2~131 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=fd9d05b0fdb0a8a2bbe2451b9e520547813d0562;p=firefly-linux-kernel-4.4.55.git sh-pfc: Fix return value check in sh_pfc_register_pinctrl() In case of error, the function pinctrl_register() returns NULL not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun Signed-off-by: Laurent Pinchart Acked-by: Linus Walleij --- diff --git a/drivers/pinctrl/sh-pfc/pinctrl.c b/drivers/pinctrl/sh-pfc/pinctrl.c index c7f3c406f9de..3e49bf0eac25 100644 --- a/drivers/pinctrl/sh-pfc/pinctrl.c +++ b/drivers/pinctrl/sh-pfc/pinctrl.c @@ -395,8 +395,8 @@ int sh_pfc_register_pinctrl(struct sh_pfc *pfc) pmx->pctl_desc.npins = pfc->info->nr_pins; pmx->pctl = pinctrl_register(&pmx->pctl_desc, pfc->dev, pmx); - if (IS_ERR(pmx->pctl)) - return PTR_ERR(pmx->pctl); + if (pmx->pctl == NULL) + return -EINVAL; return 0; }