public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] sh-pfc: fix return value check in sh_pfc_register_pinctrl()
@ 2013-03-11 14:08 Wei Yongjun
  2013-03-11 21:47 ` Laurent Pinchart
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Yongjun @ 2013-03-11 14:08 UTC (permalink / raw)
  To: linus.walleij, lethal, laurent.pinchart+renesas, horms+renesas
  Cc: yongjun_wei, linux-kernel

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

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>
---
 drivers/pinctrl/sh-pfc/pinctrl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/sh-pfc/pinctrl.c b/drivers/pinctrl/sh-pfc/pinctrl.c
index 11e0e13..271e2c1 100644
--- a/drivers/pinctrl/sh-pfc/pinctrl.c
+++ b/drivers/pinctrl/sh-pfc/pinctrl.c
@@ -439,8 +439,8 @@ int sh_pfc_register_pinctrl(struct sh_pfc *pfc)
 		return ret;
 
 	pmx->pctl = pinctrl_register(&sh_pfc_pinctrl_desc, pfc->dev, pmx);
-	if (IS_ERR(pmx->pctl))
-		return PTR_ERR(pmx->pctl);
+	if (!pmx->pctl)
+		return -EINVAL;
 
 	sh_pfc_gpio_range.npins = pfc->info->last_gpio
 				- pfc->info->first_gpio + 1;


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-03-13 17:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-11 14:08 [PATCH -next] sh-pfc: fix return value check in sh_pfc_register_pinctrl() Wei Yongjun
2013-03-11 21:47 ` Laurent Pinchart
2013-03-13 17:43   ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox