diff mbox series

[v2,1/3] i2c: iop3xx: fix deferred probing

Message ID ca5278f3-9d4e-9cd0-7f0e-91b48d20735a@omp.ru
State New
Headers show
Series [v2,1/3] i2c: iop3xx: fix deferred probing | expand

Commit Message

Sergey Shtylyov June 24, 2021, 8:21 p.m. UTC
When adding the code to handle platform_get_irq*() errors in the commit
489447380a29 ("[PATCH] handle errors returned by platform_get_irq*()"),
the actual error code was enforced to be -ENXIO in the driver for some
strange reason.  This didn't matter much until the deferred probing was
introduced -- which requires an actual error code to be propagated
upstream from the failure site.

While fixing this, also stop overriding the errors from request_irq() to
-EIO (done since the pre-git era).

Fixes: 489447380a29 ("[PATCH] handle errors returned by platform_get_irq*()")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>

---
Changed in version 2:
- added an article and a space to the patch description;
- updated domain in the OMP email addresses.

 drivers/i2c/busses/i2c-iop3xx.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff mbox series

Patch

Index: linux/drivers/i2c/busses/i2c-iop3xx.c
===================================================================
--- linux.orig/drivers/i2c/busses/i2c-iop3xx.c
+++ linux/drivers/i2c/busses/i2c-iop3xx.c
@@ -467,16 +467,14 @@  iop3xx_i2c_probe(struct platform_device
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
-		ret = -ENXIO;
+		ret = irq;
 		goto unmap;
 	}
 	ret = request_irq(irq, iop3xx_i2c_irq_handler, 0,
 				pdev->name, adapter_data);
 
-	if (ret) {
-		ret = -EIO;
+	if (ret)
 		goto unmap;
-	}
 
 	memcpy(new_adapter->name, pdev->name, strlen(pdev->name));
 	new_adapter->owner = THIS_MODULE;