Skip to contentSkip to conversation

pinctrl: ti-iodelay: Fix return value check in ti_iodelay_probe()

PATCH In review Wei Yongjun 3 participants 3 messages Jan 17, 2017 – Jan 18, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pinctrl: ti-iodelay: Fix return value check in ti_iodelay_probe()

From: Wei Yongjun <[email protected]>

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")
---
 drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pinctrl/ti/pinctrl-ti-iodelay.c +2 -2
index 3b86d3d..8899f5e 100644
@@ -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;
 	}
 
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

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")
Quoted 20 lines
---
 drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pinctrl/ti/pinctrl-ti-iodelay.c +2 -2
index 3b86d3d..8899f5e 100644
@@ -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;
 	}
 
#2 lore raw
In reply to Wei Yongjun
Quoted 8 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

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

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