]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
sh-pfc: Fix return value check in sh_pfc_register_pinctrl()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Mon, 11 Mar 2013 14:08:12 +0000 (22:08 +0800)
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Fri, 15 Mar 2013 12:33:52 +0000 (13:33 +0100)
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 <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/sh-pfc/pinctrl.c

index c7f3c406f9dec55d4526d7d9f5c4f802655de6ac..3e49bf0eac25faa2a6c96e3bd73456993b822d70 100644 (file)
@@ -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;
 }