]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
i2c: iop3xx: fix deferred probing
authorSergey Shtylyov <s.shtylyov@omp.ru>
Thu, 12 Aug 2021 20:35:09 +0000 (23:35 +0300)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 15 Oct 2021 09:27:18 +0000 (11:27 +0200)
BugLink: https://bugs.launchpad.net/bugs/1946788
[ Upstream commit a1299505162ad00def3573260c2c68b9c8e8d697 ]

When adding the code to handle platform_get_irq*() errors in the commit
489447380a29 ("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>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/i2c/busses/i2c-iop3xx.c

index 2f8b8050a223375b8fec23999032df2a2bd6b137..899624721c1eaa04cb0df8eb1d0a3cccc03bfc76 100644 (file)
@@ -467,16 +467,14 @@ iop3xx_i2c_probe(struct platform_device *pdev)
 
        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;