linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] pinctrl: ti-iodelay: Fix return value check in ti_iodelay_probe()
@ 2017-01-17 14:41 Wei Yongjun
  2017-01-17 23:02 ` Tony Lindgren
  2017-01-18 23:29 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2017-01-17 14:41 UTC (permalink / raw)
  To: Linus Walleij, Rob Herring, Nishanth Menon, Lokesh Vutla,
	Tony Lindgren
  Cc: Wei Yongjun, linux-gpio

From: Wei Yongjun <weiyongjun1@huawei.com>

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.

Fixes: 003910ebc83b ("pinctrl: Introduce TI IOdelay configuration driver")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
index 3b86d3d..8899f5e 100644
--- a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
+++ b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
@@ -892,9 +892,9 @@ static int ti_iodelay_probe(struct platform_device *pdev)
 	iod->desc.owner = THIS_MODULE;
 
 	iod->pctl = pinctrl_register(&iod->desc, dev, iod);
-	if (!iod->pctl) {
+	if (IS_ERR(iod->pctl)) {
 		dev_err(dev, "Failed to register pinctrl\n");
-		ret = -ENODEV;
+		ret = PTR_ERR(iod->pctl);
 		goto exit_out;
 	}


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

* Re: [PATCH -next] pinctrl: ti-iodelay: Fix return value check in ti_iodelay_probe()
  2017-01-17 14:41 [PATCH -next] pinctrl: ti-iodelay: Fix return value check in ti_iodelay_probe() Wei Yongjun
@ 2017-01-17 23:02 ` Tony Lindgren
  2017-01-18 23:29 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Tony Lindgren @ 2017-01-17 23:02 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Linus Walleij, Rob Herring, Nishanth Menon, Lokesh Vutla,
	Wei Yongjun, linux-gpio

* Wei Yongjun <weiyj.lk@gmail.com> [170117 06:42]:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> 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.
> 
> Fixes: 003910ebc83b ("pinctrl: Introduce TI IOdelay configuration driver")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Acked-by: Tony Lindgren <tony@atomide.com>

> ---
>  drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
> index 3b86d3d..8899f5e 100644
> --- a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
> +++ b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
> @@ -892,9 +892,9 @@ static int ti_iodelay_probe(struct platform_device *pdev)
>  	iod->desc.owner = THIS_MODULE;
>  
>  	iod->pctl = pinctrl_register(&iod->desc, dev, iod);
> -	if (!iod->pctl) {
> +	if (IS_ERR(iod->pctl)) {
>  		dev_err(dev, "Failed to register pinctrl\n");
> -		ret = -ENODEV;
> +		ret = PTR_ERR(iod->pctl);
>  		goto exit_out;
>  	}
> 

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

* Re: [PATCH -next] pinctrl: ti-iodelay: Fix return value check in ti_iodelay_probe()
  2017-01-17 14:41 [PATCH -next] pinctrl: ti-iodelay: Fix return value check in ti_iodelay_probe() Wei Yongjun
  2017-01-17 23:02 ` Tony Lindgren
@ 2017-01-18 23:29 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2017-01-18 23:29 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Rob Herring, Nishanth Menon, Lokesh Vutla, Tony Lindgren,
	Wei Yongjun, linux-gpio@vger.kernel.org

On Tue, Jan 17, 2017 at 3:41 PM, Wei Yongjun <weiyj.lk@gmail.com> wrote:

> From: Wei Yongjun <weiyongjun1@huawei.com>
>
> 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.
>
> Fixes: 003910ebc83b ("pinctrl: Introduce TI IOdelay configuration driver")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

This does not apply on the devel branch of the pin control
tree. Please rebase it and resend. Include Tony's ACK.

Yours,
Linus Walleij

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

end of thread, other threads:[~2017-01-18 23:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-17 14:41 [PATCH -next] pinctrl: ti-iodelay: Fix return value check in ti_iodelay_probe() Wei Yongjun
2017-01-17 23:02 ` Tony Lindgren
2017-01-18 23:29 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).