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

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).