All of lore.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

* Re: [PATCH -next] sh-pfc: fix return value check in sh_pfc_register_pinctrl()
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Laurent Pinchart @ 2013-03-11 21:47 UTC (permalink / raw)
  To: Wei Yongjun, horms+renesas
  Cc: linus.walleij, lethal, yongjun_wei, linux-kernel

Hi Wei,

Thank you for the patch.

On Monday 11 March 2013 22:08:12 Wei Yongjun wrote:
> 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>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

I've taken the patch in my tree and will push it to v3.10.

> ---
>  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;

-- 
Regards,

Laurent Pinchart


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

* Re: [PATCH -next] sh-pfc: fix return value check in sh_pfc_register_pinctrl()
  2013-03-11 21:47 ` Laurent Pinchart
@ 2013-03-13 17:43   ` Linus Walleij
  0 siblings, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2013-03-13 17:43 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Wei Yongjun, horms+renesas, lethal, yongjun_wei, linux-kernel

On Mon, Mar 11, 2013 at 10:47 PM, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> Hi Wei,
>
> Thank you for the patch.
>
> On Monday 11 March 2013 22:08:12 Wei Yongjun wrote:
>> 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>
>
> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
> I've taken the patch in my tree and will push it to v3.10.

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.